Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

validation using javascript in jsp

843836Feb 25 2004 — edited Feb 27 2004
does 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>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2004
Added on Feb 25 2004
35 comments
458 views