In a aspx page, I am trying to to validate when the user is checking a checkbox, if the select value of the same line has a certain value (the default one) to fire an alert message and uncheck the checkbox. I would like to realise this in javascript to avoid a postback but if possible without jquery.
<asp:ListView ID="lstView_retrievedIPPhones" runat="server" OnDataBound="lstView_retrievedIPPhones_DataBound" OnItemDataBound="lstView_retrievedIPPhones_ItemDataBound">
<LayoutTemplate>
<table id="tbl1" runat="server" class="bordered">
<tr id="tr1" runat="server">
<th id="th1" runat="server"><asp:CheckBox ID="chkbox_checkAllRows" runat="server" OnClick="javascript:ToogleCheckAll(this.id)"/></th>
<th id="th9" runat="server">Sites</th>
<th id="th8" runat="server">Result</th>
</tr>
<tr id="ItemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><asp:CheckBox ID="chkbox_toConfigure" runat="server" OnClick="javascript:btnclick()" /></td>
<td>
<asp:DropDownList ID="dpdown_Site" runat="server"></asp:DropDownList>
</td>
<td><asp:Image ID="imgResultLastOp" tooltip= "" runat="server" /></td>
</tr>
</ItemTemplate>
<EmptyDataTemplate></EmptyDataTemplate>
</asp:ListView>
In the above code, when clicking on chkbox_toConfigure, I want to validate that the DropDownList selectedvalue is not the default one.
Your help would be greatly appreciated.