Hi all

On my jsp page i m having two tables..
first table have 14 rows which takes input type=text.

and

my second table is having 9 rows which also takes 9 inputs.

Thus total 23 inputs on a form..
Now when the user click submit, i want to check if total of 20 inputs are fill or less than that..
Means user can input max 20 inputs from both the tables..

plz reply for such validation..

Thanks..

Two ways:

First: Use javascript: Instead of type="submit", use:
<input type="button" value="Button" onclick="someMethod()"/>
Inside the someMethod you can check the length of the inputs in order to see how many were given ans act accordingly: submit the form or print an error message with the alert() function.

Second (Not as good as the first): Submit the from and when you get the values of the inputs use java to check their length. Then if you don't have enough inputs you redirect to the previous page in order for the user to give the right inputs.

Finally, I would suggest that you make your question to a javascript forum

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.