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

  • Home
  • SEARCH
  • 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 6473439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:28:00+00:00 2026-05-25T06:28:00+00:00

I have a project I am currently working on that has multiple validators and

  • 0

I have a project I am currently working on that has multiple validators and events when a postback is created (classic asp validator controls).

I have a client method called when the submit button is clicked. It makes ajax calls to various services and once everything is done a postback is done (via a classic document.forms[0].submit() for now).

The problem here is that my javascript method is run before every other javascript calls on the event queue. The second problem is that my method returns false to block the PostBack (I do async calls so I need to make sure a PostBack is made only when I am sure every processing is completed).

I would like to either call this method at the end of the validation queue or manually call each validations inside of the method itself and then run the ajax calls.

Here is a POC to explain the problem (plain simple page):

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script type="text/javascript">
        Validate = function () {
            setTimeout(function () { document.forms[0].submit() }, 2000);

            return false;
        }
    </script>


    <asp:TextBox runat="server" ID="txtSomething"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" onclientclick="return Validate();" Text="Button" />
    <asp:RequiredFieldValidator runat="server" ID="valRequiredTruc" ControlToValidate="txtSomething">something is required</asp:RequiredFieldValidator> 
</asp:Content>

Here, the Validate function blocks the postback to do something anything. After 2 seconds a Postback is created and the RequiredFieldValidator validate contents but server side. I would like to make it validate client side.

  • 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-25T06:28:01+00:00Added an answer on May 25, 2026 at 6:28 am

    maybe the javascript function Page_ClientValidate() can help you. using this method you can trigger the page validations.

    http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/28/executing-server-validators-first-before-onclientclick-javascript-confirm-alert.aspx

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

Sidebar

Related Questions

I have a pet project that I'm working on that has multiple worker threads.
I have a project that I'm currently working on but it currently only supports
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
i am currently working on a project where i have 'units' that will have
I am currently working on a vba project that has the end user copy/paste
I am currently working on a project that has a number of COM objects
I am currently working on a project which contains a window, that has a
I'm currently working a project that has me working with XML a lot. I
I am currently working on a project that has components in perl, .NET, C/C++,
I'm currently working on a fairly large project that has been migrated from Ant

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.