The documentation says to use the GetText() function to get the text, once you've got the Combo object.
So I used this:
But the Catch block activates, with the message:
"TypeError: comboBox.GetText is not a function"
(You will see that I *did* call GetText() with brackets, avoiding that simple error!)
However, if I use this code:
Then I DO get the right value back!
But this is 'bad form' right?
Shouldn't I be using the proper function for the combo?
So why doesn't it work?
(BTW the combo is used in a callback scenario - does this make a difference?)
tia
Steve
So I used this:
| function GetComboText(id) { /* Get a reference to the Combo */ |
| //onclick="window.radopen('Companies.aspx?Popup=1&Name=' + GetComboText(ctl00_ContentPlaceHolder1_fvJobEdit_cmbLocation), 'rwCompanyEdit'); return false;" |
var comboBox = document.getElementById(id); |
| alert("combo id=" + comboBox.id); |
| try { |
| var T = comboBox.GetText(); |
| } |
| catch(err) { |
| alert(err); |
| } |
But the Catch block activates, with the message:
"TypeError: comboBox.GetText is not a function"
(You will see that I *did* call GetText() with brackets, avoiding that simple error!)
However, if I use this code:
| function GetComboText(id) { /* Get a reference to the Combo */ |
| //onclick="window.radopen('Companies.aspx?Popup=1&Name=' + GetComboText(ctl00_ContentPlaceHolder1_fvJobEdit_cmbLocation), 'rwCompanyEdit'); return false;" |
| var inputID = id + "_Input" |
| try { |
| var comboBoxInput = document.getElementById(inputID); |
| alert("comboBoxInput=" + comboBoxInput.value); |
| } |
| catch(err) { |
| alert("no comboBoxInput"); |
| } |
Then I DO get the right value back!
But this is 'bad form' right?
Shouldn't I be using the proper function for the combo?
So why doesn't it work?
(BTW the combo is used in a callback scenario - does this make a difference?)
tia
Steve