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="confirmcontainer" id="confirmcontainer" method="post" action="submit.jsp">

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

<tr><td><input type="submit" name="submit" vlaue="submit"></td></tr>
<% } %>

</form>

Thanks & Regards,

Tamilvanan

Recommended Answers

All 7 Replies

come back in about a year. Maybe we will have time for you by then.

In other words, there's nothing urgent about it for us. You stating that it is, and thus that you're more important than everyone else and we should all drop what we're doing to help you in incredibly rude.

SQL> select * from week;

MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY
---------- ---------- ---------- ---------- ---------- ---------- ----------
0 0 0 0 0 1 1

how to retrieve the above fields which containing the value 1 using sql query.
pls help me

DaniWeb Member Rules include:
"Do not hijack old threads by posting a new question as a reply to an old one"
http://www.daniweb.com/forums/faq.php?faq=daniweb_policies

Post your question in a new thread of your own, but also remember this:
DaniWeb Member Rules include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"
http://www.daniweb.com/forums/announcement8-2.html

Member Avatar for hfx642

Wait a minute...
I'm still trying to figure out how a code snippet of HTML
and an SQL query... is related to java?!?!?!

you call

MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY
---------- ---------- ---------- ---------- ---------- ---------- ----------
0 0 0 0 0 1 1

a code snippet of html???

Member Avatar for hfx642

No... What the OP posted was HTML!!
Didn't you read it???

However... I DID miss the hijacking part.
Sorry! :)
I guess I have egg on my face. (Yum!!)

what the OP posted wasn't plain HTML. it was a .jsp fragment.
just check the first two lines:

<form name="confirmcontainer" id="confirmcontainer" method="post" action="submit.jsp">

<% for(int i=0;i<value.length;i++) {%>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.