hi there could any one solve this problem for me plzz.....
In my site iam generating multiple textfields and i need to wite validation for that
function valid(){
for(var i=0;i<4;i++){
if(document.getElementById('d'+i).value == ""){
alert("not empty");
return false;
}
return true;
}
}
<form name="f1">
<input name="cc1" id="d1" type="text" value="0" />
<input name="cc2" id="d2" type="text" value="0" />
<input name="cc3" id="d3" type="text" value="0" />
<input name="cc4" id="d4" type="text" value="0" />
<input name="submit" type="submit" onclick="return valid()" />
</form>