Does anyone know the syntax for a "Select all" option??.
I have an asp page with check boxes allowing the user to select(check) one by one. However i want to give the user the option of select all (batch) in one go.
ANy ideas...
Printable View
Does anyone know the syntax for a "Select all" option??.
I have an asp page with check boxes allowing the user to select(check) one by one. However i want to give the user the option of select all (batch) in one go.
ANy ideas...
Give all of your checkboxes the same ID (I'm assuming your creating these checkboxes dynamically in a loop), and reference them using the index..
This code will actually toggle the checked state:
Code:Sub cmdCheckAll_onclick
Dim lngLoop
on error resume next
for lngLoop = 0 to document.all.length
If document.all.item(lngLoop).id = "chkMyCheckBox" Then
document.all.item(lngLoop).Checked = not(document.all.item(lngLoop).Checked)
End If
Next
End Sub