Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie check box validation on jsp - HELP!!

Robert Barker
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help! I've been banging my head against a brick wall for about 3 days now, gotta try for help!
This is my first bit of jsp code and I don't have much experience in javascript either.
I am trying to validate and block the selection of more than three check boxes from a list driven from a database(called db2). once the check boxes have been selected the form parameters are POSTed to another jsp.
I've tried it a number of ways (on submit, onclick etc.) but the fact that it is driven from a database using jsp sql connectivity seems to cause all sorts of problems as I am looping to retrive data from the database Could someone have a look and perhaps suggest something ?
java.sql.Connection connection = java.sql.DriverManager.getConnection("jdbc dbc:db2");
java.sql.Statement statement = connection.createStatement();
java.sql.ResultSet columns = statement.executeQuery("SELECT PRODUCT.TYPE, PRODUCT.ID FROM PRODUCT");
int index = 0;%>
while( {
<TR> <TD> <%= columns.getString("Type") %> </TD>
<TD> <INPUT TYPE="CHECKBOX" VALUE="<%= columns.getInt("ID")%>" NAME="productid_<%= index%>"></TD> </TR>
<% } %>
<INPUT TYPE="SUBMIT" VALUE="Click here to compare">

Yours in Frustration
[This message has been edited by Robert Barker (edited July 09, 2001).]
[This message has been edited by Robert Barker (edited July 09, 2001).]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic