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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:50:41+00:00 2026-05-17T21:50:41+00:00

Is it possible to have multiple contact forms on one page and still validate

  • 0

Is it possible to have multiple contact forms on one page and still validate and send an email without the page refreshing.

I have used the tutorial below but if copied obviously this still only validates the original form…

http://www.ajaxfreak.com/2009/12/03/submit-a-form-without-page-refresh-using-jquery/

I could copy the JS etc for each of the required forms but there must be a more efficient way of doing this, maybe with hidden values & form ids?.

Anybody have any ideas?

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-17T21:50:42+00:00Added an answer on May 17, 2026 at 9:50 pm

    It is certainly possible, unfortunately the demo manually builds the data string manually using IDs, which doesn’t make it easy to convert to multiple forms. It would be much more convenient to use the .serialize() method on the form.

    The following (simplified) example should work for any number of forms on the page that have the class “ajax”. Input elements with the ‘required’ class will be checked for a value first, and will have background red color applied if it’s missing:

    $('form.ajax').submit(function() {
       var validates = true;
       $(this).find('input.required').each(function() {
          if($(this).val() == '') {
             $(this).css('background', '#ff9999');
             validates = false
          } else {
             $(this).css('background', '#ffffff');
          }
       }
       if(validates)  {
          $.ajax({
             type: "POST",
             url: "bin/process.php",
             $(this).serialize(),
             success: function() {
                 // things to do on success here!
             }
          });
       }
       return false; // prevent normal form submission.
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have multiple view of the same display object? (e.g. same-computer
Is it possible to have multiple listeners to messages carried by MSMQ? WCF appears
Is it possible to have multiple folders where I can place applications to be
On IIS 6, is it possible to have multiple domain names pointing to the
A single Biztalk Server can have multiple Host processes. Is it possible to create
Is it possible to have a file belong to multiple subpackages? For example: /**
I have multiple Service contracts defined in one WCF library which are hosted under
Is it possible to have multiple Shared Preferences per app? If you create a
Is it possible to have multiple values under the same field in a .csv
Is it possible to use BindingSource.find on multple columns? I have a treeview and

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.