| Author |
Changing code
|
K Robert
Ranch Hand
Joined: May 16, 2003
Posts: 116
|
|
I have the following: Origially, this was used to grab the value of a radio button, but I needed to change this to a listbox. Can I use the same code for a <select> if I name the <select> "callerName" and I keep the "value=" attributes the same for the listbox as I did for the radio buttons? [ December 30, 2005: Message edited by: K Robert ] [ December 30, 2005: Message edited by: K Robert ]
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
var sel = forms['CONFIG'].elements['CallerName']; var strValue = sel.options[sel.selectedIndex].value; var strText = sel.options[sel.selectedIndex].text; Eric
|
 |
K Robert
Ranch Hand
Joined: May 16, 2003
Posts: 116
|
|
|
Great thanks! But, how do I select the right value to display in the listbox base on the variable name?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
loop through the options, read the value, then select when found. Eric
|
 |
 |
|
|
subject: Changing code
|
|
|