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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:19:12+00:00 2026-06-07T20:19:12+00:00

I did a jQuery form (form1) which bring another form(form2) in that page through

  • 0

I did a jQuery form (form1) which bring another form(form2) in that page through ajax.
Now I want to submit the form2 data through ajax.

But whenever I click the button, it submit the whole page. I mean the whole page reloads.

$(document).ready(function() {
        $("#form2").submit(function() {
            $(this).ajaxSubmit({
                    beforeSubmit: function(before) {
                        $('.loading_result').html('Loading...');
                    },
                    success: function(dd) {
                        $('.loading_result').html(dd);
                    }
            }); 
            return false;
        });

    });

All the JavaScript codes in the parent page. I don’t have any JavaScript codes in ajax pages

//

page.php
* There is a form (form1) in this page.
* All the jQuery functions are inside the page.php

When the form1 is submitted, it brings data from page2.php // It works good.
** page2.php gives form2.

Now when i submit the from2 (which is also in page.php after the ajax request) it does not trigger the jquery function inside page.php

  • 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-07T20:19:13+00:00Added an answer on June 7, 2026 at 8:19 pm

    Instead of binding the form submit on $(document).ready, I usually just include an “onclick” event to the form’s button:

    <button type='submit' onclick='MyAjaxFunction();return false;'>Submit</button>
    

    The return false; portion of the onclick will prevent the form from submitting.

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

Sidebar

Related Questions

I did a tutorial for a jquery carousel that scrolls a ul. At the
I've created a page which combines an inline jQuery UI datepicker . I wan't
I have a form with markup like this.... Which voucher did you cut out
[I did see the similar problems solved with AJAX/jQuery, so please read on]. I
I want to use a good old form element on my page. But I
I have a login page using jQuery Mobile which contains the following code: <div
I did a code in jquery and ajax with working very well in Safari,
I want to trigger this function, which uses the jquery's post method, when a
I have a web application with HTML / jQuery which ic connected with AJAX
Which jQuery form plugin do you use, and would you recommend it? Which other

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.