Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Feb 2010
    Thanked 0 Times in 0 Posts

    How to prevent validation on textbox control

    I have this:
    <asp:TextBox ID="QueryTxt" runat="server" asp:TextBox> <asp:RequiredFieldValidator   Display="Dynamic" ID="RequiredFieldValidator2" runat="server" ErrorMessage="Error 2" ControlToValidate="QueryTxt"></asp:RequiredFieldValidator>
    <asp:CheckBox ID="MyCheckBox" Text="Get Text only" runat="server" />
    As you see I have a textbox, but when I click on the checkbox I want the the validaton of the textbox to be ignored. Is this possible? I have tried to use causesvalidation ="false" on the textbox but it doesn´t work. I don´t want to use causesvalidation on the button-control because in some cases I need to validate the textbox and in some, I dont - depends on Checkbox. Is this possible?
    Last edited by earni23; 05-14-2011 at 10:56 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts