Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 13, 2012 03:06 AM by BU XI - MSFT
Member
149 Points
476 Posts
Feb 10, 2012 10:17 AM|LINK
Hi There
I am using a MutuallyExclusiveCheckBox and have come across a validation issue I can't seem to find the solution I need.
One of the two checkboxes is required, before the button 'btnMsg' fires:
<asp:CheckBox ID="chkMonthly" OnCheckedChanged="chkMonthly_CheckedChanged" Text="Monthly Returns" AutoPostBack="True" Checked="False" runat="server" /> <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender1" TargetControlID="chkMonthly" runat="server" Key="uploadConts"> </cc1:MutuallyExclusiveCheckBoxExtender> <asp:DropDownList ID="monthsDDL" runat="server" AutoPostBack="True" DataSourceID="dsMonths" DataTextField="PeriodDesc" DataValueField="PeriodIDNo" ToolTip="Select pay cycle" Width="90px" Visible="False"> </asp:DropDownList> <br /> <asp:CheckBox ID="chkWeekly" OnCheckedChanged="chkWeekly_CheckedChanged" Text="Weekly Returns" AutoPostBack="true" Checked="False" runat="server" /> <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender2" TargetControlID="chkWeekly" runat="server" Key="uploadConts"> </cc1:MutuallyExclusiveCheckBoxExtender> <asp:DropDownList ID="weeklyDDL" runat="server" AutoPostBack="True" DataSourceID="dsweeks" DataTextField="PeriodDesc" DataValueField="PeriodIDNo" ToolTip="Select pay cycle" Width="90px" Visible="False"> </asp:DropDownList> </blockquote> </fieldset> <br /><br /> <asp:Label ID="lblConfirm" runat="server" Text=" You have chosen to submit returns"></asp:Label> <asp:Label ID="lblCycle" runat="server" Font-Bold="True"></asp:Label> <br /> <asp:Label ID="lblConfirmUpload" runat="server" Text="Label"> Would you like to upload </asp:Label> <asp:Button ID="btnMsg" runat="server" Text="Confirm" />
All-Star
22367 Points
2704 Posts
Microsoft
Feb 13, 2012 03:06 AM|LINK
Hello
Please try javascript to validate if the checkbox is checked, for your reference,
http://lab.artlung.com/validate-checkbox/
In your case, you'll use an *or* to see if either of these is checked.
callan1
Member
149 Points
476 Posts
MutuallyExclusiveCheckBox - Required validation
Feb 10, 2012 10:17 AM|LINK
Hi There
I am using a MutuallyExclusiveCheckBox and have come across a validation issue I can't seem to find the solution I need.
One of the two checkboxes is required, before the button 'btnMsg' fires:
<asp:CheckBox ID="chkMonthly" OnCheckedChanged="chkMonthly_CheckedChanged" Text="Monthly Returns" AutoPostBack="True" Checked="False" runat="server" /> <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender1" TargetControlID="chkMonthly" runat="server" Key="uploadConts"> </cc1:MutuallyExclusiveCheckBoxExtender> <asp:DropDownList ID="monthsDDL" runat="server" AutoPostBack="True" DataSourceID="dsMonths" DataTextField="PeriodDesc" DataValueField="PeriodIDNo" ToolTip="Select pay cycle" Width="90px" Visible="False"> </asp:DropDownList> <br /> <asp:CheckBox ID="chkWeekly" OnCheckedChanged="chkWeekly_CheckedChanged" Text="Weekly Returns" AutoPostBack="true" Checked="False" runat="server" /> <cc1:MutuallyExclusiveCheckBoxExtender ID="MutuallyExclusiveCheckBoxExtender2" TargetControlID="chkWeekly" runat="server" Key="uploadConts"> </cc1:MutuallyExclusiveCheckBoxExtender> <asp:DropDownList ID="weeklyDDL" runat="server" AutoPostBack="True" DataSourceID="dsweeks" DataTextField="PeriodDesc" DataValueField="PeriodIDNo" ToolTip="Select pay cycle" Width="90px" Visible="False"> </asp:DropDownList> </blockquote> </fieldset> <br /><br /> <asp:Label ID="lblConfirm" runat="server" Text=" You have chosen to submit returns"></asp:Label> <asp:Label ID="lblCycle" runat="server" Font-Bold="True"></asp:Label> <br /> <asp:Label ID="lblConfirmUpload" runat="server" Text="Label"> Would you like to upload </asp:Label> <asp:Button ID="btnMsg" runat="server" Text="Confirm" />BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: MutuallyExclusiveCheckBox - Required validation
Feb 13, 2012 03:06 AM|LINK
Hello
Please try javascript to validate if the checkbox is checked, for your reference,
http://lab.artlung.com/validate-checkbox/
In your case, you'll use an *or* to see if either of these is checked.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework