Checkbox are shown to visitors to get the opinion on a fixed value. Sometime the visitors may have to submit more than one choice out of a group of options
In this article I am simply demonstrating how to get the values of all the checkboxes selected by visitors in classic ASP form
1. Create an selectoption.asp page
2. Put following line of code in it
In the above code the name of all the check boxes are same with different values so they will be treated as a group of checkbox.
3. Now create a ASP page with the name processing.asp and put the bellow mention code in it
Dim strmode, Arrmode,i
strmode =Request("test1 ")
We have used test1 as the common name so all the values of the checkbox for which the visitor has checked will be available as Request("test1 ") as comma separated values. So in the above code the variable mode value will be consisting of all checked values separated by comma.
4. Now let split the string to get the array of checked values.
5. Now we will loop through the array by using for for loop and UBound function to print out the checked values of the checkboxes.
For i=LBound(Arrmode) to UBound(Arrmode)
Response.Write Arrmode_a(i) + " "