I am new to this group and would appreciate any help.
I need to modify my JSP to create a shopping cart interface.

I have a form which contains:
1)Checkbox: Is checked if record ID is to be added to shopping cart; Checked value is 
record ID from the ID column.
2)Button: Submits form (or other method) to add ID to cart variable.
3)Variable: String variable that accepts record ID's.
4)Button: To go to shopping cart display page, to show cart contents in repeating 
table.

Code snippets:

CHECKBOX, CHECKED IF RECORD IS TO BE SENT TO CART
<input type="checkbox" name="checkboxID" value="<%=(((school_data = 
school.getObject("ID"))==null || school.wasNull())?"":school_data)%>">

ADD BUTTON: PRESS TO ADD CHECKED RECORDS TO CART
<input type="submit" name="Submit" value="Add Checked to Cart">

COLLECTS ID'S FROM CHECKBOX TO BE SENT TO CART
String school_varCheckbox = null;// Is null value the same as unchecked?
if (request.getParameter ("checkboxID") !=null) {school_varCheckbox = 
(String)request.getParameter ("checkboxID") ;}

GO TO CART
<input type="button" name="butGoToCart" value="View Cart" 
onClick="window.location='Cart.jsp'">

What is the most preferable way to do this?

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to