I have a form in a jsp page shopping cart page. The form contains a text box (quantity) and a drop down box where a user can select a size. Once the details are keyed in a user submits them to a servlet which updates the details on screen.
The drop down box and text box are part of a loop
which obviously means you can have more than 1 product, quantity and drop down boxes in the cart at a time.
My problem is when I hit the submit button my drop down box goes back to the default selection and therefore messes up my price. This does not happen with quantity. Does anybody know how to prevent the drop down box doing this?
Thanks for your help!!
If you are using beans, the following code will help.
<select name="empName" size=1>
<option value="<%=EmployeeBean.getEmpName()%>" selected><%=EmployeeBean.getEmpName()%></option>
Unforunately I'm not using beans. Thanks for your help anyway