Groups | Blog | Home
all groups > asp.net > february 2008 >

asp.net : javascript to either enable or disable the dropdown


bruce barker
2/12/2008 8:31:08 AM
as there is no "oncheckedchanged" event for a checkbox, you are just defining
a custom attribute. try: "onclick"

also it really a bad practice to view source to get the control names, you
shouald ask the control for is ClientID:

-- bruce (sqlwork.com)


[quoted text, click to view]
zlf
2/12/2008 10:24:35 PM
I need a javascript to either enable or disable the dropdowns when the user
clicks on the checkbox and do NOT post back to the server.
I tried the following, but it does not work. How to correct it?

AssignToQueueCheckBox.Attributes["oncheckedchanged"] =
"document.getElementById('ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$WorkUnitDropDownList').disable=!document.getElementById('ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$WorkUnitDropDownList').disable;"
+


Thanks

zlf

zlf
2/13/2008 1:53:32 AM
"onclick" does not work too :(

"bruce barker" <brucebarker@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:F64E8F05-6FE8-44DB-AC31-8A3848E40045@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button