Forums Register Login

checkbox

+Pie Number of slices to send: Send
when user adds books to cart in online book store, books are displayed with checkbox in front of every book. There is a Remove button at the bottom. I want to remove all the books checked after user clicks Remove button. But i am able to remove only the first book added to the form.
For this i have dynamic checkbox name and dynamic checkbox value.
<% int count = 0; %>
while {
<! -- code -->
<% String countvalue = Integer.toString(count); %>
<% out.println(" the value is " + countvalue + shopelement1.sku);%>
<td align="center"><input type="checkbox" name="<%= countvalue%>" value="<%= shopelement1.sku%>"></td>
<% count++;%>
<% } %>
On server side, i am not able to extarct the value of countvalue properly.. using request.getParameter("countvalue");
I dont know if this is the right way to do it.. please let me know if its ok this way.
+Pie Number of slices to send: Send
Hi Arpit,
if i get ur problem right..u need to remove the books that are checked from the cart when Remove button is clicked....why should u go to the server for that...can u not do it on the client side using javascript unless u have already written to the database.
hope i understood ur problem right....reply if u have any clarifications!!
bye
shrig
+Pie Number of slices to send: Send
hi arpit,
u definitely have to use client side java script for it
because their is no other way to capture value on client side
so write one function to get count value on client and then finally collect it on server.

thanks
saurabh
+Pie Number of slices to send: Send
thanks saurabh and shri
i will try using javascript. didn't think about that.
thanks a lot again.
Replace the word "snake" with "danger noodle" in all tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 514 times.
Similar Threads
Need Help with binding click events to table rows
How to enable checkbox when checked in other checkbox dynamically
Dynamic rows validation from javascript
How to get Names of selected checkboxes?
How to add parameters to the action dynamically
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:13:50.