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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:38:42+00:00 2026-06-04T10:38:42+00:00

this is a a page A.html <form name=form> <input type=text id = txtA> </form>

  • 0

this is a a page A.html

<form name=form>
<input type=text id = txtA>
</form>

when i load using jquery to B.html
i load multiple times.

<form name=form>
<input type=text id = txtA>
</form>

<form name=form>
<input type=text id = txtA>
</form>

<form name=form>
<input type=text id = txtA>
</form>

<form name=form>
<input type=text id = txtA>
</form>

How can i rename the form name to form1,form2,form3…formN
so i can get this

<form name=form1>
<input type=text id = txtA>
</form>

<form name=form2>
<input type=text id = txtA>
</form>

<form name=form3>
<input type=text id = txtA>
</form>

when i submit i want to use php to retrieve the data.

for each form
    formi.txtA

this way i can get each form data uniquely.

  • 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-04T10:38:43+00:00Added an answer on June 4, 2026 at 10:38 am

    This would rename all forms called form and postfix an increasing number:

    $('form[name="form"]').each(function(i) {
        this.name = 'form' + (i + 1);
    });
    

    When you load the forms one by one, you need a different approach:

    var renamer = (function() {
        var i = 1; // private counter
    
        // return public interface
        return function(base) {
            $(base).find('form[name="form"]').each(function() {
                this.name = 'form' + i;
                ++i;
            });
        }
    }());
    

    For every time you add a new form, you call this:

    renamer('#divid');
    

    Where '#divid' is the jQuery selector for the parent node where your form is in.

    Update

    It seems that you have multiple input fields that you dynamically load. Instead of loading a whole new form, just load the <input /> fragment.

    $(`#form`).load('http://www.example.com/inputfield?type=dob');
    

    The server would then return a fragment:

    <input name="dob" type="text" value="" />
    

    This then gets inserted into one form, so you can submit it to PHP.

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

Sidebar

Related Questions

Using javascript, how to open a text-file or html-file from a web-page and load
I am using following code to display HTML Form on my web page. This
I have a table inside a form that looks as follows: <td><input type=text name=code[0]
I've made my search form with html and jquery. When I input a name
Let's say I'm at http://www.domain.com/page.html . I want to submit this form: <FORM METHOD=post
I have this html page which is very simple, it contains a text box
On this page: http://www.anasiamusic.com/bio.html in the body text (Ana Sia's DJ crate is a
Try to download this page: http://www.4shared.com/get/B4AgMkcw/cookies.html I can use wget/firefox to get the whole
On the first page(page1.php) which is an HTML form,content such as this is present:
I have to do an HTML page with 2 text boxes, one for name

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.