Greeting;
I have asp.net dropdownlist control with Ajax CascadingDropDown control.
I also I have asp.net checkbox control. I want to enable/disable CascadingDropDown when the checkbox checked/unchecked using jquery.
I tried diffrent ways but they did not work and if I want to set enable property for the dropdownlist to false it will not work so I have to set the CascadingDropDown enable property to false to disable it but I do not know how.
this is one of the code I tried:
<asp:CheckBox ID="chkWF" runat="server" onclick="enableDDL"/>
<asp:DropDownList ID="WF" runat="server"></asp:DropDownList>
<cc1:CascadingDropDown ID="WF_CascadingDropDown" runat="server"
TargetControlID="WF"
Category="WF"
LoadingText="Please Wait ..."
PromptText="Select Work Field ..."
ServiceMethod="GetWorkField"
ServicePath="../ServiceTags.asmx" Enabled="True">
</cc1:CascadingDropDown>
function enableDDL() {
$('#<%= chkOccup.ClientID %>').click(function() {
if ($('#<%= WF_CascadingDropDown.ClientID %>').attr('disabled') != true)
$('#<%= WF_CascadingDropDown.ClientID %>').attr('disabled', true);
else
$('#<%= WF_CascadingDropDown.ClientID %>').attr('disabled', false);
});
}