Wiki Link: [discussion:4845]
rjs:PopCalendar groupvalidation not work properly when set to-control  

Jul 19 2011 at 1:48 PM
I have to calendar control as fromDate and toDate which linked with txtFromDate and txtEndDate resp. fromDate => To-Control="txtEndDate " so date should pickup upto enddate. but if enddate is lessthan start date I got two validation message.

Please help how to display only one validation message at a time.

code snap:

<table border="0" cellpadding="0" cellspacing="0" style="border-right: 0px; border-top: 0px;
border-left: 0px; width: 100%; border-bottom: 0px; border-collapse: collapse">
<tr>
<td align="left" class="SchedulerHeadCap" valign="middle">
<asp:TextBox runat="server" ID="txtFromDateMain" AutoCompleteType="None" CssClass="SchedulerHeadCap"
MaxLength="10" Width="100px" EnableViewState="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvFromDateMain" runat="server" ControlToValidate="txtFromDateMain"
Display="Dynamic" CssClass="sym-AsterixError" ></asp:RequiredFieldValidator>
</td>
<td align="left" class="SchedulerHeadCap" valign="middle" style="padding-left: 2px">
<rjs:PopCalendar ID="popCalendarFromDateMain" runat="server" Separator="/" ShowErrorMessage="false"
From-Message="The start date is out of range." BackColor="Yellow" BorderColor="Black"
BorderStyle="Solid" InvalidDateMessage="" Control="txtFromDateMain" Shadow="True"
ShowWeekend="True" Move="True" Format="mm dd yyyy" Fade="0.5" RequiredDateMessage="Enter a start date."
Culture="en-US English (United States)" BorderWidth="1px" Buttons="<my >"
RequiredDate="True" ControlFocusOnError="True" From-Increment="0" From-Today="true"
AutoPostBack="True" To-Control="txtToDateMain" KeepInside="false" />
</td>
<td style="width: 100%">
</td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" style="border-right: 0px; border-top: 0px;
border-left: 0px; width: 100%; border-bottom: 0px; border-collapse: collapse">
<tr>
<td align="left" class="SchedulerHeadCap" valign="middle">
<asp:TextBox runat="server" ID="txtToDateMain" AutoCompleteType="None" CssClass="SchedulerHeadCap"
MaxLength="10" Width="100px" EnableViewState="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvToDateMain" runat="server" ControlToValidate="txtToDateMain"
Display="Dynamic" CssClass="sym-AsterixError" ></asp:RequiredFieldValidator>
</td>
<td align="left" class="SchedulerHeadCap" valign="middle" style="padding-left: 2px">
<rjs:PopCalendar ID="popCalendarToDateMain" runat="server" Separator="/" ShowErrorMessage="false"
BackColor="Yellow" BorderColor="Black" BorderStyle="Solid" To-Message="Enter an end date."
InvalidDateMessage="Enter an end date." Control="txtToDateMain" Shadow="True"
ShowWeekend="True" Move="True" Format="mm dd yyyy" Fade="0.5" RequiredDateMessage="Enter an end date."
Culture="en-US English (United States)" BorderWidth="1px" Buttons="<my >"
RequiredDate="True" ControlFocusOnError="True" From-Increment="0" From-Today="true"
From-Control="txtFromDateMain" AutoPostBack="True" ValidationGroup="GrpEmail"
KeepInside="false" />
</td>
<td align="left" class="SchedulerHeadCap" style="padding-left: 2px; white-space: nowrap;
width: 100%;" valign="middle">
<asp:CheckBox runat="server" ID="chkNeverEnds" CssClass="SchedulerHeadCap" Checked="false"
OnCheckedChanged="ChkNeverEnds_OnCheckedChanged" AutoPostBack="true" />
</td>
<td style="width: 100%">
</td>
</tr>
</table>


Updating...
Page view tracker