0

How to access the asp.net dropdownlist selecteditem value from javascript? I have the following code here where i want to access the dropdownlist selecteditem value in the javascript , and pass that value as a query string to another page

      function Example()
                 {

                     var e =  $find("ExampleDropDownList");
                     var strUser = e.options[e.selectedIndex].value;
                     alert(strUser);
                     window.radopen("ExampleDetail.aspx?Id=" + strUser, "Dailog");
                     return false;
                }

 <telerik:RadComboBox ID="ExampleDropDownList" runat="server" >
    </telerik:RadComboBox>

1 Answer 1

2

ASP.Net Controls always render back into plain HTML Controls. When using javascript you can call the item exactly as you normaly would a dropdown. The dropdown list will have the ID of your RadComboBox.

var myDropDown = document.getElementById('ExampleDropDownList');

and you will have access to your dropdown list.

Sign up to request clarification or add additional context in comments.

2 Comments

how to access the selected item value?
var myDropDownSelectedValue = myDropDown.options[myDropDown.selectedIndex].value;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.