Rad Combobox.Options not working

1 posts, 0 answers
  1. Bhagath Reddy
    Bhagath Reddy avatar
    1 posts
    Member since:
    Jun 2011

    Posted 14 Jun 2011 Link to this post


    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;
    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.

Back to Top