Discussions

Web tier: servlets, JSP, Web frameworks: jsp/forum problem

  1. jsp/forum problem (2 messages)

    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!!

    Threaded Messages (2)

  2. jsp/forum problem[ Go to top ]

    hi,

    If you are using beans, the following code will help.

    <select name="empName" size=1>
    <option value="<%=EmployeeBean.getEmpName()%>" selected><%=EmployeeBean.getEmpName()%></option>
    <option value="AK">AK</option>
    <option value="WI">WI</option>
    </select>

    /
    murali
  3. jsp/forum problem[ Go to top ]

    Unforunately I'm not using beans. Thanks for your help anyway