admin
06-04-2003, 02:40 PM
An example would be that you have a bunch of checkboxes all with the same name:
<input type="checkbox" name="CheckBoxes" value=1>
<input type="checkbox" name="CheckBoxes" value=2>
<input type="checkbox" name="CheckBoxes" value=3>
<input type="checkbox" name="CheckBoxes" value=4>
...
...
so when you do a Request.Form it will give you a nice list of values that were checked. Next, you turn this list into an array...
'since the list of values are automatically made into a comma-separated string, you use the Split() function to separate the values and place them into the array...
arrArray = Split(Request.Form("CheckBoxes"),",")
And then finally you build your SQL statement...
sql = "Select * From table"
For i = 0 To UBound(arrArray)
If i = 0 Then
sql = sql & " Where "
Else
sql = sql & " And "
End If
sql = sql & arrArray(i) & " IN properties_field"
Next i
<input type="checkbox" name="CheckBoxes" value=1>
<input type="checkbox" name="CheckBoxes" value=2>
<input type="checkbox" name="CheckBoxes" value=3>
<input type="checkbox" name="CheckBoxes" value=4>
...
...
so when you do a Request.Form it will give you a nice list of values that were checked. Next, you turn this list into an array...
'since the list of values are automatically made into a comma-separated string, you use the Split() function to separate the values and place them into the array...
arrArray = Split(Request.Form("CheckBoxes"),",")
And then finally you build your SQL statement...
sql = "Select * From table"
For i = 0 To UBound(arrArray)
If i = 0 Then
sql = sql & " Where "
Else
sql = sql & " And "
End If
sql = sql & arrArray(i) & " IN properties_field"
Next i