wood burning stoves 2.0*
The moose likes Servlets and the fly likes Newbie check box validation on jsp - HELP!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Newbie check box validation on jsp - HELP!!" Watch "Newbie check box validation on jsp - HELP!!" New topic

Newbie check box validation on jsp - HELP!!

Robert Barker

Joined: Jul 09, 2001
Posts: 1
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(columns.next()) {
<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).]
Don't get me started about those stupid light bulbs.
subject: Newbie check box validation on jsp - HELP!!
Similar Threads
problem in retrieving data from a DB to HTML through JSP
how to fetch the value of the checkbox in jsp?
auto-generate new ticket on each page
jsp: forward page problem