Checkbox Issue

T

Tom

Hello
I have a response write statement that isnt giving the results I expect. It
is giving a radio type choice where only one of the options can be picked
rather than a checkbox that will allow multiple choices. The data is
displayed correctly but it appears to be a radio choice instead of a
checkbox.

I am trying to update a database with the user choices in a checkbox. The
number of checkboxes on a page can vary that is why I am using the dynamic
value (description) and the dynamic name (array) for each question. My
plan is to set up a loop to loop thru each question on the form and get each
checkbox value for each question and write to a database.

thanks for any help or comments!
Tom

array = rs.getrows
For i = 0 to stop

Do While Not rs2.EOF
Response.Write "<INPUT type=CHECKBOX value=""" & rs2("description").value &
""" & NAME=""" & array(4,i) & """ /> "
rs2.MoveNext
Loop

!--> other display on page -->
next i
 
W

William Morris

Well, the code as displayed is incorrect. You've got some weird stuff
happening with your quotes and ampersans. Try:

response.write "<input type=checkbox value=""" _
& rs2("description") _
& """ name=""" _
& array(4, 1) & """>"

On a side note, you might select a different name for your array. "array"
is a reserved word in some languages, and it's better programming practice
to make your variable names descriptive, anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top