How to get the values for checked and unchecked chekboxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ttamilvanan81
    New Member
    • Mar 2007
    • 35

    How to get the values for checked and unchecked chekboxes

    Hai i have using the checkbox in for loop.
    I need the urgent help from anyone,

    for example in the loop there is having 5 checkbox if i checked 3 of the ckeckboxes and 2 of the checkboxes are unchecked. I need to get the values for checked checkboxes and unchecked checkboxes. Because if i checked the checkboxes, those values need to be inserted into the database. Those for unchecked checkboxes values need to be deleted from the database. Can anyone help me for this

    i am using the following jsp code for this. If anyone can know about this please post me the sample code.

    <form name="confirmco ntainer" id="confirmcont ainer" method="post" action="submit. jsp">

    Code:
    <% for(int i=0;i<value.length;i++) {%>
    <tr> 
    <td><input name="assigncontainer_chkbox" d="assigncontainer _chkbox" type="checkbox" value="<%=value[0]%>"></td>
    <td class="bottomborder"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=value[1]%> </font></div></td>
    <td bgcolor="#FFFFFF" class="bottomborder"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%=value[2]%></font></td>
    </tr>
    <% } %>
    
    </form>

    Thanks & Regards,

    Tamilvanan
  • dav3
    New Member
    • Nov 2006
    • 94

    #2
    try doing some searching on the

    isSelected method.


    I had a similar problem with radio buttons not too long ago, this method solved all my problems.

    Comment

    Working...