Toggle Input Checkboxs

This is a "how-to" I've wanted for working with HTA and other web apps.

Add a 'chkAll' input box to your form and
and onclick event which calls the routine shown. An 'all' click will toggle checkbox state of all INPUT checkboxes on the page or form. You can then set items individually...

Sub chkAll_Click
 Dim _
 laaa, _
 chkBox, _
 oTag, _
 Set chkBox = _
 For  each oTag in chkBox
  If oTag.type = "checkbox" and _<>"chkAll" Then
   If oTag.checked = vbTrue Then
    oTag.checked = vbFalse         
    oTag.checked = vbTrue         
   End If     
  End If 
End Sub

No comments:

Favorite Tweets