We help IT Professionals succeed at work.

how to get checkboxes values on a form in classic ASP

mmalik15
mmalik15 asked
on
In a classic ASP application, I need to have a list of checkboxes on a form. And also there will be an item Other-Please specify, with a textbox.(see attached screen shot). I need to get all the selected values from the checboxes including any value added in other textbox if any.
checkboxlist.png
Comment
Watch Question

Top Expert 2011
Commented:
<p>Please select every sport that you play.</p>
Soccer: <input type="checkbox" name="sports" value="soccer"  /><br />
Football: <input type="checkbox" name="sports" value="football"  /><br />
Baseball: <input type="checkbox" name="sports" value="baseball"  /><br />
Basketball: <input type="checkbox" name="sports" value="basketball"  />
Other: <input type="checkbox" name="sports" value="other"  /> <input type="text" name="sports_other" value="" />

Open in new window


Request.Form("sports") will return you a comma delimited list of sports:
e.g.,  soccer,football,other

Request.Form("sports_other") will give you the text entered for "other"

Author

Commented:
Excellent nap0leon