I have 2 ComboBox(cboA,cboB) and 1 Textbox in a Page.
When the cboA _SelectedIndexChanged (Server Side, AJax Postback), it will base on some condition to enable or disable cboB.
If cboB enabled and when cboB_OnClientSelectedIndexChanged(Client Side), it will call JS Script to Show or Hide the textbox.
Here is the JS script:
| function ShowHideTextbox() { |
| var cboB = $find("<%= cboB.ClientID %>"); |
| var txtbox = $find("<%= textbox1.ClientID %>"); |
| var SelectedText = cboB.get_text(); |
| if (SelectedText == 'Other') { |
| txtbox.set_visible(true); |
| } |
| else { |
| txtbox.set_visible(false); |
| } |
| } |
Every time I will get the following error when the above script reach on this line var SelectedText = cboB.get_text();
"Microsoft JScript runtime error: 'null' is null or not an object".