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

Rad Combobox.Options not working

0 Answers 61 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Bhagath Reddy
Top achievements
Rank 1
Bhagath Reddy asked on 14 Jun 2011, 11:15 AM

Hi,


I have one rad combo box. I have to fill it with options array in java script.Here is code.

I am using one function for adding options to combo box.here is the function .

   function addOption(selectbox, text, value) {
                var optn = document.createElement("OPTION");
                optn.text = text;
                optn.value = value;
                selectbox.options.add(optn);

            }
And I am looping and adding options to combobox.

 for (var i = 0; i < strArray.length; i++) {

                addOption($find("<%= SavedPresetMenu.ClientID %>"), strArray1[i], strArray[i]);
                } Here SavedPresetMenu is rad combobox Id.In the above function I am getting one javascript error.
selectbox.options is undefined.And if I clear options array also getting same error.

 $find("<%= SavedPresetMenu.ClientID %>").options.length = 0;
In this line also getting  same error. How to use rad combobox in this situation.

Any ideas, suggestions would be greatly appreciated.


Thanks,
Bhagath.






No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Bhagath Reddy
Top achievements
Rank 1
Share this question
or