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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:52:53+00:00 2026-05-16T07:52:53+00:00

I have a form submit button that has asp.net validators hooked up to it.

  • 0

I have a form submit button that has asp.net validators hooked up to it. If I make a javascript function to change the text to processing on click it does not work. The button flags the validators and also causes the whole page to post back. Heres the code I have:

C#

 protected void Page_Load(object sender, EventArgs e)
{
    btnPurchase.Attributes["onClick"] = "submit()";
}

Html

<script type="text/javascript">
    function submit() {
        document.getElementById("ctl00_ContentPlaceHolder1_btnPurchase").value = "Processing";
    };
</script>

My goal is to change the buttons text to purchasing onclick if the form passes validation, and then in my code behind it will change back to the original value once the form posts back.

  • 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-16T07:52:53+00:00Added an answer on May 16, 2026 at 7:52 am

    I ran across this solution which works 100% perfect. I’m using the script manager with update panels…

    <script type="text/javascript">
    
            // Get a reference to the PageRequestManager.
            var prm = Sys.WebForms.PageRequestManager.getInstance();
    
            // Using that prm reference, hook _initializeRequest
            // and _endRequest, to run our code at the begin and end
            // of any async postbacks that occur.
            prm.add_initializeRequest(InitializeRequest);
    
    
            // Executed anytime an async postback occurs.
            function InitializeRequest(sender, args) {
                // Get a reference to the element that raised the postback,
                //   and disables it.
                $get(args._postBackElement.id).disabled = true;
                $get(args._postBackElement.id).value = "Processing...";
            }
            // Executed when the async postback completes.
            function EndRequest(sender, args) {
                // Get a reference to the element that raised the postback
                //   which is completing, and enable it.
                $get(args._postBackElement.id).disabled = false;
                $get(args._postBackElement.id).value = "Purchase";
            }
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that has a submit button in it somewhere. However, I
I have a form element and that has a normal submit button but I
I have a html form with no submit button. I want to submit that
I have a form in an HTM page that, after pressing the submit button,
I have a method, -(void)validateFormInput:(UITextField *)textField that gets called when the form's submit button
I have a form where the submit button triggers a function. Let's call it
I have a form where the submit button triggers a function. Let's call it
I have a form with a submit button. I have called a function on
I have one form that has several elements and two submit buttons, one is
I have small page which has label, DropDownList and a submit button. <div> <asp:label

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.