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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:39:52+00:00 2026-06-05T10:39:52+00:00

I have multiple forms on one page and I am using ajax in my

  • 0

I have multiple forms on one page and I am using ajax in my CodeIgniter app to determine which forms get displayed after each form submit. Anyways I have labelled each form with an id so I can check which form is submitted and I am using ajax to rename the form however I need a default form name and I’m not sure how I do this?

$.ajax({                  
   url:$(this).attr('action'),
   type:'POST',
   // this is where I have added a function to put in a default response                
   data:function(respond) {
      if(respond.result == 'false') {
         var form = "form#part-one";
      } else {
         var form = respond.form;
      }
      $(form).serialize(),
   }
   dataType:'json',
   success:function(respond) {
      if(respond.result == 'false') {
         $('#error_messages').html(respond.errors);                 
      } else {
         $('#error_messages').html('');
      }
   }
});
  • 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-05T10:39:53+00:00Added an answer on June 5, 2026 at 10:39 am

    I am not exactly clear on what you are trying to do, but if you need to pass a variable from the form I suggest this.

    $('form').submit(function(e) {
       e.preventDefault();
       var formId = $(this).attr('data-id');
       // ajax goes here
    });
    
    <form name="common_name" data-id="2">
    <input type="submit" value="Go">
    </form>
    

    On any variables you add to HTML tags I suggest you always use “data-” in them so they are HTML compliant.

    Hope this helps.

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

Sidebar

Related Questions

I have multiple forms on a page, for each of them I want the
I have multiple ajax forms on page that cointain same elemets, I have jquery
I have a page with multiple forms that I submit via Ajax POSTs serially.
So i have a page that is gonna have multiple modal popups. Each one
I have a page that displays multiple Formsets, each of which has a prefix.
Is it possible to have multiple contact forms on one page and still validate
I have an application with multiple forms, each form has the same icon, so
I have WinForms app and multiple forms and want to use ErrorProvider component on
I have some code as such to submit multiple forms on my page at
I have a page with several forms. I am trying to submit one of

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.