954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to loop thru checked checkbox to retrieve its value?!?

hi there,

i am doing asp.net and had many sets of checkbox which is html checkbox and not asp checkbox.

eg:

<input type="checkbox" id="chkbox11" value="1" onclick="javascript: checkcheck(this);" runat="server">
<input type="checkbox" id="chkbox12" value="2" onclick="javascript: checkcheck(this);" runat="server">
<input type="checkbox" id="chkbox13" value="3" onclick="javascript: checkcheck(this);" runat="server">
<input type="checkbox" id="chkbox14" value="4" onclick="javascript: checkcheck(this);" runat="server">
<input type="checkbox" id="chkbox15" value="5" onclick="javascript: checkcheck(this);" runat="server">


in my code behind, how do i insert a loop to loop through the checked checkbox and retrieve the value?

thanks in advance..

ohgosh
Light Poster
41 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

Why not use the checkbox list control? This automatically places them in an array (which is your other option with normal checkboxes) so you can loop through them

f1 fan
Posting Whiz in Training
279 posts since Jan 2006
Reputation Points: 26
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You