validation using javascript in jsp
843836Feb 25 2004 — edited Feb 27 2004does any1 know how to validate form in jsp woth javascript where the number of textboxes is a variable. the name of every textboxes is different. it is named param<%=i%> where i will depends on the number of textboxes.
the following is my code but it only validate the last textbox upon submission.
<script language="Javascript" type="text/javascript">
function checkData() {
<!--
// Text Input Fields and Textareas
for(var s=0;s< <%=i%>; s++){
if (document.example.param<%=i%>.value =="") {
alert("please fill in all the blanks.");
return false; }
}
}
// -->
</script>