I have 2 textboxes like
NoDays_____ SanctionedDays____
NoDays Default value=5. NOw i want to Compare the SanctionedDays like (san.days < NoDays) and sanctionDays Textbox has to allowe only Numeric Data.
For this I have writeen a validaions as follows.
My Question is Once the RegularExpre.. validation is satisfy then only it has to go Compare validaion. Because when i enter SanctionedDays="AA" it is displaying both error messages..?
Texbox Code
my Validation CodeCode:<Asp:Textbox id="txtNoDays" BackColor="Gainsboro" ReadOnly="True" Runat="server" size="10"/> <Asp:Textbox id="txtSanDays" Runat="server" size="10" MaxLength="3"/>
How to do this? how to validate one after one?Code:<asp:CompareValidator id="comp1" ControlToValidate="txtNoDays" ControlToCompare = "txtSanDays" Type="String" Operator="GreaterThanEqual" Text="Sanctioned days should be less than days requested!" runat="server"/> <asp:RegularExpressionValidator ControltoValidate="txtSanDays" Display="Dynamic" ErrorMessage="Enter Numeric data" ValidationExpression="\d" Runat="Server" />




Reply With Quote