Getting the checked values of checkbox Array of a form in ASP
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 so here checkbox can be shown to the visitors. For example we can ask the visitor to submit what are the games they play and we can show a list of games. Visitor may select one or more ( or may select all ) games by clicking the checkboxes. Here choice can be more than one ( In case any one to be selected out of the list then radio button is to be used ) so checkbox is the best option. We will learn how to collect the checked values of the form checkbox inside ASP for further processing. Here is the html form with checkboxes.
Here we have used t1 as common name for all the checkbox with different values so they will be treated as a group of checkbox. Once the form is submitted then the values of the checked checkboxes will be available to the action page and can be collected like this.
We have used t1 as the common name so all the values of the checkbox for which the visitor has checked will be available as Request("t1") as comma separated values. So in the above code the variable mode value will be consisting of all checked values separated by comma.