PDA

Click to See Complete Forum and Search --> : Select All button on a Form


kanejone
May 3rd, 2001, 06:56 PM
Hi Guys,
I have a table that I generate with ASP. the table is contained in a form and each of the table cells have checkbox beside them. I was wondering if anyone knows how I could make a button that will select all of them. and secondly make a button that will print all the selected items.
Thanks for your help
JK

Sundance Kid
May 4th, 2001, 02:45 AM
Easy ;)

The Code

<Script Language = "Vbscript">

Sub btn_button_onclick()

Dim checkbox
Dim Tempstr

For each checkbox in document.formname
if checkbox.type = "checkbox" then
checkbox.checked = true
end if
Next

End Sub
</Script>


<input type = "button" name = "btn_button">

You can use this code for any control on the screen.