Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 20, 2008 06:31 PM by budugu
Member
261 Points
893 Posts
Nov 20, 2008 06:12 PM|LINK
I am starting with javascript and need to know how to detect the selection change of a dropdownlist in javascript?
thank you
All-Star
41132 Points
6021 Posts
Nov 20, 2008 06:19 PM|LINK
You can use "onchange" event in JS..check this..
DropDownList1.Attributes.Add("onchange", "getIndex();") ;// where getIndex is JS function
Nov 20, 2008 06:26 PM|LINK
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
Nov 20, 2008 06:31 PM|LINK
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;
bcweed966
Member
261 Points
893 Posts
how to detect a DropDownList selectionchange and reteive the selected value on the client with ja...
Nov 20, 2008 06:12 PM|LINK
I am starting with javascript and need to know how to detect the selection change of a dropdownlist in javascript?
thank you
budugu
All-Star
41132 Points
6021 Posts
Re: how to detect a DropDownList selectionchange and reteive the selected value on the client wit...
Nov 20, 2008 06:19 PM|LINK
You can use "onchange" event in JS..check this..
"Don't be afraid to be wrong; otherwise you'll never be right."
bcweed966
Member
261 Points
893 Posts
Re: how to detect a DropDownList selectionchange and reteive the selected value on the client wit...
Nov 20, 2008 06:26 PM|LINK
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
budugu
All-Star
41132 Points
6021 Posts
Re: how to detect a DropDownList selectionchange and reteive the selected value on the client wit...
Nov 20, 2008 06:31 PM|LINK
"Don't be afraid to be wrong; otherwise you'll never be right."