This question is locked. New answers and comments are not allowed.
Hello,
When I test the following code:
=====
<% Html.BeginForm("Save", "Home"); %>
<%= Html.Telerik().DropDownList()
.Name("productID")
.Items(item =>
{
item.Add().Text("Chai").Value("1").Selected(true);
item.Add().Text("Chang").Value("2");
item.Add().Text("Tofu").Value("3");
})
%>
<% Html.EndForm(); %>
=====
it produces a drop-down with the names. Yet, I am unable to:
- get the value of the selected item in a Javascript (eg. document.getElementById('productID').value)
What I'm trying to do is:
- when "Chang" is selected, I want to get the value "2" in a javascript. (...I don't see how I may get "Chang" either...)
What am I missing? :-)
Thank you!
When I test the following code:
=====
<% Html.BeginForm("Save", "Home"); %>
<%= Html.Telerik().DropDownList()
.Name("productID")
.Items(item =>
{
item.Add().Text("Chai").Value("1").Selected(true);
item.Add().Text("Chang").Value("2");
item.Add().Text("Tofu").Value("3");
})
%>
<% Html.EndForm(); %>
=====
it produces a drop-down with the names. Yet, I am unable to:
- get the value of the selected item in a Javascript (eg. document.getElementById('productID').value)
What I'm trying to do is:
- when "Chang" is selected, I want to get the value "2" in a javascript. (...I don't see how I may get "Chang" either...)
What am I missing? :-)
Thank you!