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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:39:09+00:00 2026-05-20T03:39:09+00:00

I have a checkout-button on my site wich dynamicly loads the form where the

  • 0

I have a checkout-button on my site wich dynamicly loads the form where the user can fill in his/her personal details.
The form has an id of #order. After the form is loaded it must call the .submit function from the jquery-form plugin.

When i first made this it did not work so i put my minimal debug skills to use (placing alert’s, i know not the best method ;-)). Suddenly it worked when i put an alert between the loading of the form and the .submit call.

I figured it had something to do with the form not being completely loaded before calling the .submit. But after a quick search i found that the .html function is synchronous so any code
executed after the .html() call will definitely occur after the html
is set.

Can someone please help me with this problem?

$('.checkout').live('click', function(event) {
  event.preventDefault();                       
  $.get('/gva/templates/gva/form.html', function(data){
    $('#blog').html(data);
  });
  alert('with this alert it works, without it doesn't'); 

  var options = { 
    target:        '#response',   
    beforeSubmit:  validate,  
    success:       showResponse  
  };

  $('#order').submit(function() { 
    $(this).ajaxSubmit(options); 
    return 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-05-20T03:39:10+00:00Added an answer on May 20, 2026 at 3:39 am
    $('.checkout').live('click', function(event) {
      event.preventDefault();                       
      $.get('/gva/templates/gva/form.html', function(data){
        $('#blog').html(data);
    
        var options = { 
          target:        '#response',   
          beforeSubmit:  validate,  
          success:       showResponse  
        };
    
        $('#order').submit(function() { 
          $(this).ajaxSubmit(options); 
          return false; 
        });
      });
    });
    

    The alert caused a delay which ensured the DOM had been updated by the time the next bits of your code fired. I’ve put them in the proper handler so that they fire at the proper time.

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

Sidebar

Related Questions

I have a simple 'Buy Now' Google Checkout button on my Django site (very
I have a Google Checkout 'Buy Now' button on my site. It's very simple,
Check out this jsbin . I have a form with a custom button that
While reset and checkout have different usages most of the time, I can't see
Possible Duplicate: Read Post Data submitted to ASP.Net Form I have a google checkout
I have a scenario where i need to have a user checkout through PayPal
I am using simpleCart js. I would like to have the checkout button and
I have a hyperlink/image button that uses javascript to submit a form, <p> <a
I have observablecollection which i fill with textboxes on button click event. In my
I have a Zend view in PHP with a form: <form action=https://example.com/checkout/ name=info method=post>

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.