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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:47:12+00:00 2026-05-31T00:47:12+00:00

I have a page with multiple forms on it. Each form has it’s own

  • 0

I have a page with multiple forms on it. Each form has it’s own Save button which validates and displays error messages using .ajax() to post (not a normal post method). I also have a Next button outside of the forms which is caught by jQuery click() handler. This function goes through each form and calls $(formname).submit() for each.

Ultimately I need to know if the individual forms passed validation in order to determine if a redirect should happen. I have added, return false; in the else statement of the validate check in the submit function but I cannot see how to retrieve it.

Having alert($(this).submit()); just returns the object not a return value. Without re-coding the whole $.ajax post code for each form, is there anyway I can find out if the submit failed??

//next button click
$('#savenext').click(function () {
    var finalsuccess;
    $('.record_form').each(function (index) {
        alert($(this).submit()); //I want this to be true or false
    });
//forms each have their own submit handler
$(formname).submit(function (e) {
    e.preventDefault();
    var form = $(this);

    if($(form).valid()) { //validate the form, return false if it is not valid. 
    //Post the form to the action if it passes
        $.ajax({
            url: form.attr('action'),
            type: "POST",
            dataType: "text json",
            data: form.serialize(),
            success: function (response) {
                //does some success messages here
            },
        });
    }
    else {
        return false;
        }
});

Thanks

  • 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-31T00:47:13+00:00Added an answer on May 31, 2026 at 12:47 am

    In case anyone needs to know, I found no way to get the submit to return a success value. In the end I changed the ajax post to be async: false, put that in a function which returned a boolean set by either the success or error event of the ajax post. Not as quick because of the succession of server calls but I will add a loading dialog to help with that.

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

Sidebar

Related Questions

I have a page that displays multiple Formsets, each of which has a prefix.
I have a page which dynamically creates multiple forms, each form had a unique
I have a form with multiple tabs. Each tab has its own <form> ,
function GenKeyForm(FormNum){ document.GenNewKey+FormNum.submit(); } I have multiple forms within a php page. each form
I have multiple forms on a page, for each of them I want the
I have an ASP.NET 3.5 page which has multiple span elements with ID containing
I have a view model for a view which displays multiple forms on the
I have a page that creates multiple forms for each object that I had
I've got a page with multiple forms that load via ajax. Each form includes
I have a page with multiple forms that I submit via Ajax POSTs serially.

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.