Login | |
|
 |
RE: Populate list in HTA with array - 7/24/2007 7:06:24 AM
|
|
 |
|
| |
mcds99
Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
|
I did this HTA (with help from the forums here) that has way to much going on on the screen 8-O, I had to chop it in to smaller parts ;-) It's for Little League Baseball coaches, I don't know if I posted it... It uses an HTML drop down list that loads when the HTA runs... Function window_onload code to run when starting HTA END Function When the list is populated you do an HTML select... <Select name="TeamSelect" onChange="Team"></select>
_____________________________
Sam Keep it Simple Make it Fun KiSMiF
|
|
| |
|
|
|
 |
RE: Populate list in HTA with array - 7/25/2007 1:34:31 AM
|
|
 |
|
| |
CondoPC
Posts: 118
Score: 0
Joined: 7/23/2007
Status: offline
|
OK, this worked well, Thanks! Now on to the next problem created: I made the select list (or any select list) able to accept multiple selections. How do I get the values from that? I first tried the following code and only got one server, even though I selected more than one. 'verify values and present for testing msgbox "Servers: " & cbxServers.value ~... <td> <!-- options are populated via script based on environment selection --> <select name="cbxServers" size="8" multiple="true"></select> </td> ...~ So then I tried the following and get errors because it's not valid to do this (I was just guessing): strServersPicked = cbxServers.value(0) & "," & cbxServers.value(1) 'verify values and present for testing msgbox "Servers: " & strServersPicked As a side note, I also noted that my scroll bar does not appear (even though it works) when I build the select list dynamically as suggested. It's not a show stopper, just a glitch. Any one else experience this?
|
|
| |
|
|
|
 |
RE: Populate list in HTA with array - 7/25/2007 2:55:49 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
You will need to loop through the collection to find selected items. For Each objOption In cbxServers.Options If objOption.Selected Then 'do something with objOption.Text or objOption.Value End If Next
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: Populate list in HTA with array - 7/25/2007 3:20:54 AM
|
|
 |
|
| |
CondoPC
Posts: 118
Score: 0
Joined: 7/23/2007
Status: offline
|
Thanks, That worked great. Now if I could fix the scroll bar, but no biggie. Thanks all for your help!!
|
|
| |
|
|
|
 |
RE: Populate list in HTA with array - 7/25/2007 3:28:18 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Define "Fix" and show the code you are using to dynamically create the options.
< Message edited by Rischip -- 7/25/2007 3:40:59 AM >
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
 |
RE: Populate list in HTA with array - 7/25/2007 3:44:44 AM
|
|
 |
|
| |
Rischip
Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
|
Try this ~... <td> <!-- options are populated via script based on environment selection --> <select name="cbxServers" size="8" multiple></select> </td> ...~ instead of this ~... <td> <!-- options are populated via script based on environment selection --> <select name="cbxServers" size="8" multiple="true"></select> </td> ...~
_____________________________
Rischip Author of - The Grim Linker
|
|
| |
|
|
|
|
|