Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 3rd, 2003, 11:20 PM
Registered User
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic form checkboxes

I`m trying to generate a form with rows from a database and a checkbox, so that when the user checks a checkbox the program executes a SQL statement with all the rows that are checked.

I`m trying the following code to generate the checkboxes.

<% dim i
while not tabla.EOF %>
<%dim tot1,totval
<td> <% =tabla.Fields("codigo")%> </td>
<td> <% =tabla.Fields("titulo")%> </td>
<td><input type="checkbox" name="cb"&<%= i %> value=tabla.Fields("codigo")>

<% i=i+1

Then on the asp page that receives the form submit, I`m trying to access the value of the rows with cb&i name to perform the SQL statement with those rows, but I don`t get any results.

I`m new to ASP, please help. :(
Old August 4th, 2003, 03:30 PM
Authorized User
Join Date: Jul 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ALoPresto

Your tabla.Fields("codigo") in the field declaration needs to be in <% %> because it's ASP code. Maybe that will help.

AIM: LoPrestoAtWork

Trusant Technologies, LLC
Old August 5th, 2003, 12:01 AM
Registered User
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jeff zhao Send a message via MSN to jeff zhao

try this:

<input type="checkbox" name="cb<%= i %>" value="<%=tabla.Fields("codigo")%>">

Similar Threads
Thread Thread Starter Forum Replies Last Post
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
How to extract data from Dynamic Checkboxes? leothelion123 BOOK: Professional C#, 2nd and 3rd Editions 0 October 11th, 2006 04:35 AM
Dynamic Checkboxes using dynamic Select Values bsheridan Classic ASP Databases 0 March 12th, 2006 10:17 AM
Form element "memory" - for checkboxes SoC VBScript 1 September 1st, 2004 04:35 AM
multiple dynamic checkboxes mlog Classic ASP Basics 0 February 14th, 2004 04:49 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.