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

8 Years
Discussion Span
Last Post by network18

first decide against what (format ) you want to validate with them, like all numbers or all chars or no special chars etc.
If thats the case, better to this in javascript.


i need required field validation.. any way i got one way to do that.. here is the javascript for that.. with this code i can customize with my requirement.

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 will work for the required filed validatons..

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.