Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:00:16+00:00 2026-05-23T09:00:16+00:00

I have an issue with causes validation on my link button in my aspx

  • 0

I have an issue with causes validation on my link button in my aspx page. What I have is a page with two text boxes, some validation controls and a submit button. The validation controls have enable client script set to true, and have validation groups. My asp image button has a validation group assigned and causes validation equal to true. I have the focus set to my first text box.

My link button is a click here to learn more about….. and I’ve specified the validation group and set causes validation to false. In Chrome, everything works fine. In IE, when either clicking any where on the page besides the submit button, or when clicking my link button, my first text box is validated and the error is presented. Now, if I click on the link button again, I am redirected to the page I desire.

This seems a bit weird to me, any one have any ideas?

So, how do I fix this, so IE won’t validate until only the submit button is clicked.

Here is what my code looks like:

<span>Value 1:</span>
<asp:TextBox ID="Value1TextBox" runat="server" />
<asp:RequiredFieldValidator ID="Value1_1_Validator" EnableClientScript="true" ControlToValidate="Value1TextBox" Display="Dynamic" ForeColor="Red" Text="is required" ValidationGroup="MyValGroup" runat="server" />
<asp:RegularExpressionValidator ID="Value1_2_Validator" EnableClientScript="true" ControlToValidate="Value1TextBox" ValidationExpression="\somevalexpression\" Display="Dynamic" ForeColor="Red" Text="is not valid" ValidationGroup="MyValGroup" runat="server" />
...
<span>Value 2:</span>
<asp:TextBox ID="Value2TextBox" runat="server" />
<asp:RequiredFieldValidator ID="Value2_1_Validator" EnableClientScript="true" ControlToValidate="Value2TextBox" Display="Dynamic" ForeColor="Red" Text="is required" ValidationGroup="MyValGroup" runat="server" />
...
...
<asp:ImageButton ID="SubmitButton" ImageUrl="~/Images/submit.png" OnClick="SubmitButton_Click" ValidationGroup="MyValGroup" CausesValidation="true" runat="server" />
...
<asp:LinkButton ID="OurPolicyLink" PostBackUrl="~/Policy.aspx" ValidationGroup="MyValGroup" CausesValidation="false" Text="click here" runat="server" />

I came up with a fix using jquery and javascript, its not as clean, but it does work. I would have thought just doing causes validation equal to false would be enough. Perhaps I was wrong.

I have a script javascript file, here is what is looks like.

$(function () {

    $"[id$=_Value1TextBox]").focus();

    $("[id$=_Validator]").each(function () {
        $(this)[0].enabled = false;
    });

    $("[id$=_SubmitButton]").click(function () {

        $("[id$=_Validator]").each(function () {
            $(this)[0].enabled = true;
        });

        Page_ClientValidate("MyValGroup");

        if (!Page_IsValid) {
            return false;
        }

        return true;

    });

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:00:17+00:00Added an answer on May 23, 2026 at 9:00 am

    It is because you are setting the focus on the text box. When the focus leaves the text box it is triggering validation. Either don’t set the focus on the text box or set CuasesValidation=False on the TextBox. The problem with latter option is that it won’t validate the text box until something else in the same validation group triggers the validation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an issue on our page whereby the first time a button posts
I have some issue with a Perl script. It modifies the content of a
I'm running into an issue with a formatting converter and data validation. I have
I have some jQuery code that, without it in the document it passes validation
I'm having a validation issue that I can't figure out. I know I have
I'm having an issue with an image button that I have built. When I
I have found an interesting issue in windows which allows me to cause the
I have an issue that is driving me a bit nuts: Using a UserProfileManager
We have an issue using the PEAR libraries on Windows from PHP . Pear
We have an issue related to a Java application running under a (rather old)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.