|
-
Jul 16th, 2005, 09:53 PM
#1
Thread Starter
Fanatic Member
Mulitple Checkbox with same name
I have a html page with 4 checkbox with the same name... When I submit my form how do I get the value of each item in the array using request.form??
I tried response.write "Test" & request.form("chkbox[0]") but no luck..
-
Jul 17th, 2005, 01:01 AM
#2
New Member
Re: Mulitple Checkbox with same name
Is request.form("chkbox")(0)?
-
Jul 18th, 2005, 05:16 AM
#3
Re: Mulitple Checkbox with same name
Give the checkboxes a value
Code:
<input type="checkbox" name="checks" value="1"><br/>
<input type="checkbox" name="checks" value="2"><br/>
<input type="checkbox" name="checks" value="3"><br/>
<input type="checkbox" name="checks" value="4"><br/>
Then in the Asp use the Request.Form("checks")
this will return a string indicating which values are checked. Only the checkboxes that are selected will get POSTed.
For example if I check the odd numbered ones Request.Form will return
"1,3"
If I check them all it will return
"1,2,3,4"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|