Reputation: 3217
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>
Upvotes: 0
Views: 2639
Reputation: 1125
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.
Upvotes: 2