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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:13:11+00:00 2026-06-05T19:13:11+00:00

I have button which post values of form to url but during post i

  • 0

I have button which post values of form to url but during post i want to capture that value into my database too.
So on button click i made new thread of ajax and paused by while loop so user can not redirect due to post of form.

But problem is program not responding in while loop and not posting ajax call.

function btnSubmitId_Onclick() {

    window.setTimeout(function () {

        var FirstName = $(txtFirstNameId).val()
        var Email = $(txtEmailId).val()

        AJAXPost(   //Url
                "Signup"
                , //Data
                {Ip: Ip, CustomerKey: CustomerKey, FirstName: FirstName, Email: Email }
                , //Success
                function (data) {
                    response2 = true;
                }
                , //error
                function (xhr, textStatus, errorThrown) { }
            );

    }, 0);


    var date = new Date();
    var curDate = null;
    do { curDate = new Date(); }
    while (response2 == false)

}

var response2 = false;
  • 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-06-05T19:13:13+00:00Added an answer on June 5, 2026 at 7:13 pm

    You really shouldn’t do that. Active waiting is likely to block the whole browser or at least the current tab.

    Put all code that needs to run after the request succeeded in the success callback.

    Since you apparently want to both submit the form normally and use AJAX (why?!), the solution is rather simple: prevent the original submit from being handled by the browser by calling e.preventDefault() (e being the first argument passed to the jQuery event handler) and after the AJAX request succeeded .submit() the form. To avoid the AJAX request from being sent again you might need to unbind the submit event handler or set a variable after the AJAX request completed.

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

Sidebar

Related Questions

I have login form which i want to send via ajax using serialize but
On my website, I have a button which when clicked displays a feedback form
i have a form that have a field which hold query for search and
I have a submit form for a URL and I want it to have
I have a very simple scenario where I want to POST the form using
I have form where before i was using simple post with <button name=submit id=register
I have an image upload form and it works fine. But underneath that same
I have an included object's form: <form method=post class=object_form id=event-core-form action={% url save_event_core_data event.id
I have this jquery.ajax form which populates data from the database and auto fills
I have a form: <form id=form action=updatescore.php method=post> and a php file: updatescore.php which

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.