View Single Post
  #2 (permalink)  
Old 08-04-03, 03:16 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Well, for one, this line is has a few problems.

Code:
<input type="checkbox" name="cb"&<%= i %> value=tabla.Fields("codigo")>
when this renders to the browser it will look like this:

Code:
<input type="checkbox" name="cb"&1 value=>
<input type="checkbox" name="cb"&2 value=>
<input type="checkbox" name="cb"&3 value=>
...etc
So, basically, you're not naming your checkboxes "cb&NUMBER". You are naming them all "cb" but with some random characters between properties.

You are also trying to set ASP server-side code as the value for the checkbox. You need to put the tabla.Fields("codigo") call between the ASP brackets.

If you want to name all of your boxes "cb", then that's fine. You can just loop through the collection and figure out all of the values.

If you are trying to include that number in the name, then you would want to do something like:

Code:
<input type="checkbox" name="cb&<%= i %>" value="<%=tabla.Fields("codigo") %>">
Each of your checkboxes will then be named "cb&1", cb&2", cb&3" and so on. If you don't want the ampersand in there, then just take it out. Your checked checkboxes will also have a value now.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Reply With Quote