Link to home
Start Free TrialLog in
Avatar of Padre_Corleone
Padre_CorleoneFlag for United States of America

asked on

Get Value OnChange

I have a dropdown that i set a dynamic id, onChange i want to get the value of the dropdown dynamic id.

I want to dynamically add the on change attribute to something like:

mydropdownlist.attributes.add("OnChange",'GetMyValuefortheDynamicID')




Dynamic id for dropdown: id can be any number given to it
 
<asp:dropdownlist runat="server" id="12345">
<listitem>a</listitem>
<listitem>b</listitem>
<listitem>c</listitem>
</asp:dropdownlist>

Open in new window

Avatar of jainnaveen
jainnaveen
Flag of Australia image

this.id in the function will dropdown list id
Avatar of Padre_Corleone

ASKER

i have the Id but need the value when user changes dropdown though
ASKER CERTIFIED SOLUTION
Avatar of jainnaveen
jainnaveen
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know asp but why don't you output the onChange event as an attribute of the select from the server where you generate the html for the select?
thanks jainnaveen that did it.

Graceful one: i am trying to avoid using server side to improve performance.  thanks.