Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


HTA Checkbox Question

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38142
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HTA Checkbox Question
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 HTA Checkbox Question - 9/27/2006 6:29:25 PM   
  takeda kozo

 

Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
Hi guys, does anyone know how I can use "checkbox" button names in a loop ?

The below code works fine (for 2 hotfixes) , but I am checking 44 hotfixes, and I dont want to have to type out code 44 times :(

Is there a way to look through "all checked boxes" ? I am new to HTA/HTML scripting, and really not sure about this


=======================
Extract from HTML Section:

<input type="checkbox" name="KB921883" checked="yes">KB921883 (MS06-040)
<input type="checkbox" name="KB899589" checked="yes">KB899589 (MS05-046)
=======================
Extract from VBS Section

If KB921883.Checked Then
 ReDim Preserve arrHotFixes(intCounter)
 arrHotFixes(intCounter) = KB921883.Name
 intCounter = intCounter + 1
End If

If KB899589.Checked Then
 ReDim Preserve arrHotFixes(intCounter)
 arrHotFixes(intCounter) = KB899589.Name
 intCounter = intCounter + 1
End If
=======================



Is there something available like:



For each (checkbox on this form)

  If Checkbox.Name.Checked Then
 
  Blah Blah Blah

Next

(Sorry about the example, but just wanted to try and get across my meaning) :)




 
 
Post #: 1
 
 RE: HTA Checkbox Question - 9/27/2006 9:10:31 PM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
If you search the forum with the terrm: hotfix, there will be a llist of posts that you can check for more info..

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to takeda kozo)
 
 
Post #: 2
 
 RE: HTA Checkbox Question - 9/28/2006 12:55:49 AM   
  Country73


Posts: 735
Score: 10
Status: offline
Here is a snippet of what I used in one of my HTA's for checking how many checkboxes have been selected; this will currently just pop up a message box with the name of the item that is checked.

VBScript:

SUB Install_List(checkNum)
   ON ERROR RESUME NEXT
       IF checkNum.Checked = TRUE THEN
           MSGBOX checkNum.Value
       END IF
       IF ERR.Number <> 0 THEN
           FOR i = 0 TO checkNum.Length - 1
               IF checkNum(i).Checked = TRUE THEN
                   MSGBOX checkNum(i).Value
               END IF
           NEXT
       END IF
   ON ERROR GOTO 0
END SUB


HTML code for button to check all checkboxes:
<input type="button" name="installChecks" value="INSTALL" onclick="Install_List(document.myform.checkNum)">

(in reply to takeda kozo)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HTA Checkbox Question Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts