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 6367399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:32:35+00:00 2026-05-25T00:32:35+00:00

I have a product page with an add to cart button When the add

  • 0

I have a product page with an add to cart button

When the add to cart button is clicked, a couple of input fields are validated using ASP.NET validation controls (which use client-side validation to prevent the postback from occurring upon invalid input).

In order to prevent double-clicks from adding multiple items to the cart, I would like to disable the add to cart button after the initial click, but ONLY if validation has succeeded. (It would be rather bad to disable “add to cart” just because they goofed up an input)

Is it possible to handle the “on ASP.NET client-side validation succeeded” event in javascript?

I may just end up rolling my own validation mechanism for this page.

  • 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-25T00:32:36+00:00Added an answer on May 25, 2026 at 12:32 am

    Just an example, but you can adopt this to your needs:

    Markup:

    <asp:button id="bla" runat="server" Text="bla" onClientClick="ValidationCatcher()" />
    

    Script:

    function ValidationCatcher()
    {
        //force .net validation
        Page_ClientValidate();
    
        for(i=0; i < Page_Validators.length; i++)
        {
            if(!Page_Validators[i].isvalid)
            {
                //do whatever you need to do
            }
        }     
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button like this: <input type=submit id=product_197_submit_button class=wpsc_buy_button name=Buy value=Add To Cart>
I have a model relationship with Product hasmany Page. When I add a new
I have an edit page with url example.com/product/edit/11 Now if the validation is false
I'm designing a custom product page with a button that when clicked I need
I have a products page with a link Add to Cart, when this is
I am trying to add a Delete button to my product-page, but I am
I have a product listing page and want to load up a detail view
I currently have a product view page that contains an MVCContrib HTML Grid with
I have an infinite scroller for a product page which works well. For SEO
I have the following URL which links to the product page of a Mac

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.