Sign in | Join
Last post 11-20-2008 2:31 PM by budugu. 3 replies.
Sort Posts: Oldest to newest Newest to oldest
I am starting with javascript and need to know how to detect the selection change of a dropdownlist in javascript?
thank you
You can use "onchange" event in JS..check this..
DropDownList1.Attributes.Add("onchange", "getIndex();") ;// where getIndex is JS function
thank you.
how do I retreive which value was selected? what is the javascript property that retreives the user selection? is it .value or .selectedvalue?
thanks again
bcweed966:how do I retreive which value was selected?
var e = document.getElementById("DropDownList1"); //If it doesn't work, use clintID var str = e.options[e.selectedIndex].value;