Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 12, 2005, 11:35 am
rate this thread
the best way to do it.
I can't use the same name on all the checks, because I only get "on" for the
checked boxes and nothing with the unchecked boxes.
I can't figure out how to specify an array for the input element name.
When I process the results from the form submission, I need to know the
index of the checkbox in my database, so I figured that I could use the
index as part of the input element's name.
Re: Array of checkboxes...
<% dim fruitarr, fruit
fruitarr = request.form("fruit")
for each fruit in split(fruitarr,", ")
response.write "<br>choice: " & fruit
'or you can do it this way
for i = 0 to ubound(split(fruitarr,", "))
response.write "<br>choice" & i & ": " & fruitarr(i)
'now that you have values do whatever you need to do with your database
<form method="post" action="<%=request.servervariables("SCRIPT_NAME")%>">
<input type="checkbox" value="apples" name="fruit">Apples<br>
<input type="checkbox" value="oranges" name="fruit">Oranges<br>
<input type="checkbox" value="bananas" name="fruit">Bananas<br>
<input type="submit" value="Choose">
Please respond to the group so others can share