![]() |
Re: Getting checkbox value(s) from a HTML form to a JSP page
nice one i tried it
|
Re: Getting checkbox value(s) from a HTML form to a JSP page
Try using the form to stores, ie. the record id so the checked items can be retrieved from the form.
1. get result set and stores the record ID in the "id" property as a checkbox value, where getstring(1) is the record ID: while (rs.next()) { rec = new Sales(); rec.setId("<input type=\"checkbox\" name=\"selectedItems\" value=\""+rs.getString(1)+"\" />"+rs.getString(1)); 2. displays result and check box in the "id" property in jsp: <display:table class="display1" style="border:1px solid #999" name="requestScope.salesList" sort="list"> <display:column property="id" title="Row ID" sort="true" /> 3. the updateSales form has the "selectedItems" properties private String[] selectedItems = {}; public String[] getSelectedItems() { return this.selectedItems; 4. In the action form, retrieves the selected items String[] idList = updateSales.getSelectedItems(); 5. now do whatever you wish with the list of selected items Good luck! |
Re: Getting checkbox value(s) from a HTML form to a JSP page
Nice thanks
|
Re: Getting checkbox value(s) from a HTML form to a JSP page
Really an easy and nice example.
|
Re: Getting checkbox value(s) from a HTML form to a JSP page
- -!
So easy?~~!! |
Re: Getting checkbox value(s) from a HTML form to a JSP page
what about the selected box ?
can you prvide us with an artical about that , i tryed the (getParameterValues) it didnt work with me , any help please ? |
| All times are GMT +5.5. The time now is 23:03. |