This is a migrated thread and some comments may be shown as answers.

Referencing combo with javascript problem

1 Answer 61 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
TickledPink
Top achievements
Rank 1
TickledPink asked on 18 Apr 2008, 09:37 PM
I'm trying out the new AJAX controls and I have two comboboxes in a Create User Wizard. I want the second one to be populated via AJAX based on what the user selected from the first combo. So I'm trying to use the code in the multiple comboboxes example.

However, as the combobox is in a wizard I can't reference it directly:

        var regionsCombo = $find("Region");  
        var item = eventargs.get_item();  
        regionsCombo.set_text("Loading ...");  
 

When it gets to the third line I get a null reference error because it hasn't found the control. How to I make a valid reference in the first line above (my javascript skills are basic at best)?

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 21 Apr 2008, 07:59 AM
Hi TickledPink,

You could use Telerik.Web.UI.RadComboBox.ComboBoxes array. This array contains all the client -side combobox instances on the page, no matter where embedded. For example:
Telerik.Web.UI.RadComboBox.ComboBoxes[0] will return the first combobox on the page.

Hope this helps.

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
TickledPink
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or