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" wrote:
> 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
>
>
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
"onclick" does not work too :(
"bruce barker" <brucebarker@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:F64E8F05-6FE8-44DB-AC31-8A3848E40045@microsoft.com...
[quoted text, click to view] > 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)
>
>
> "zlf" wrote:
>
>> 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
>>
>>
>>