• Post Reply Bookmark Topic Watch Topic
  • New Topic

CheckBox  RSS feed

 
Sonu Sen
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am generating a project in which I am creating checkbox dynamically means from database. Now my problem is when the form is load at the same time the perticular checkbox will be selected.

I hope I am clear, Please help me.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your information is not enough
 
Sonu Sen
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for giving attention on my question..let me explain in detail.

<ul class="checklist cl3">
<%
for (int i = 0; i < itemList.size(); i++) {
Item itm=(Item )itemList.get(i) ;

%>
<li class="alt" ><label for=""><input id="c1" name="<%=itm.getItemId() %>" type="checkbox" value=<%=itm.geItemId() %> onClick="return checkId()"/><%=itm.getName() %></label></li>
<%} %>
</ul>

This is my code from which i am creating a checkbox. Now my problem is. when the form is load at the same time I want to check a perticular checkbox.How its possible? please help.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use Code tag.


you are using different name for each check box? ok . any way

get the value(checked box) on servlet set in scope and forward it to the jsp(view). and compare this with list(using contains()),if matched check .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

A title such as "checkbox" is not helpful. What would happen if all posts had such a title?

Please go back and change your post to add a more meaningful subject by clicking the button on your post.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!