Please cosider this scenario:
I have a form with 3 drop down list.I place these controls in an update panel.when my users select an Item with value greater that 2 in first drop down list I disable second and third drop down list with jQuery. My problem is after any post back all drop down list are enable.I know this is normal but how I can check the form again and disable controls that should be disable?
thanks
Edit 1)
this is my code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="100px">
<asp:ListItem Value="1" Text="1" />
<asp:ListItem Value="2" Text="2" />
<asp:ListItem Value="3" Text="3" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DropDownList2" runat="server" Width="100px">
<asp:ListItem Value="1" Text="1" />
<asp:ListItem Value="2" Text="2" />
<asp:ListItem Value="3" Text="3" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DropDownList3" runat="server" Width="100px">
<asp:ListItem Value="1" Text="1" />
<asp:ListItem Value="2" Text="2" />
<asp:ListItem Value="3" Text="3" />
</asp:DropDownList>
<br />
</td>
</tr>
</table>
<div>
<asp:Button ID="Button1" runat="server" Text="Cause Post Back" Width="200px"
onclick="Button1_Click"/>
</div>
</ContentTemplate>
</asp:UpdatePanel>
and javascript:
$(document).ready(function () {
function Disable(item) {
item.attr('disabled', 'disabled');
}
$('#DropDownList1').change(function () {
if ($(this).val() > 2) {
Disable($('#DropDownList2'));
Disable($('#DropDownList3'));
}
else {
Enable($('#DropDownList2'));
Enable($('#DropDownList3'));
}
}).change();
function Enable(item) {
item.removeAttr('disabled');
}
});
Am I missing something?