0

Hi Folks,

I have 2 texboxes with the name names like 'des0' and 'des1', So i need to validate this two controls for required filed with the help of loop. something like this

for (var i=0;i<=1;i++)
{

}

So i have confused what will write inside the loop for validate the controls. So please help me writing the things

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jithusdani
0

Hi folks I got a way to do the same here is the code for that if anyone need this take it its working fine..

function valid()
{
var inputs = document.getElementsByTagName('input'); 

for(var k=0;k<inputs.length;k++)
{
var input = inputs[k]
//if(input.type!= 'text'){ continue };
if(input.value == '')
{
alert("Enter All Fields");
return (false);
}
} 
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.