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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:27:30+00:00 2026-06-07T18:27:30+00:00

I created a list that auto-grows as new content is added. It’s a simple

  • 0

I created a list that auto-grows as new content is added. It’s a simple example for me to learn with that allows people to add their siblings and their age (here it is: http://jsfiddle.net/j08691/bhamU). I added a submit button to the code and am sending it to a url to be processed.

Html:

<form>
<div class="family">
    <input name="age" value=0>  <input name="sibling" value="name?">
    <hr />
</div>
</form>

Javascript:

$("form").on('keydown',"input[name='age']:last", function() {
    $('.family:last').clone().insertAfter(".family:last");
})

The problem is, if I enter:

 Bob - 25 
 Cindy - 24 
 Greg - 26  

The results I get are:

 Greg - 26
 Greg - 26
 Greg - 26

The number of results are always the same as the number of siblings I enter but the actual results are always the last entry repeated. (I’m using Pyramid and using the request.POST command to see what’s being posted).

I’m wondering if this is because I’m cloning the two inputs and their names are being repeated? Is there something I should be doing to make the forms identifiable after cloning?

I am using this to get the data:

def submitchange(request):
    for x in request.POST:
        print x, ' = ', request.POST[x]

It outputs the correct number of inputs but all items are a duplicate of the last entry.

  • 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-07T18:27:32+00:00Added an answer on June 7, 2026 at 6:27 pm

    that’s because they have similar name attributes, you should change their name attributes after cloning. try this:

    <form>
    <div class="family">
        <input name="age_1" value=0>  <input name="sibling1" value="name?">
        <hr />
    </div>
    </form>
    

    $("form").on('blur',"input[name^='age']:last", function() {
        var name = parseInt(this.name.slice(-1), 10)
        $('.family:last').clone().insertAfter(".family:last");
        $('.family:last').find('input[name^="age"]').attr('name', 'age_'+(name+1)).val("")
    })
    

    DEMO

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

Sidebar

Related Questions

I created the list that have device detected, and I want to send data
I have created a list view that displays the names and dates of items
I have created a list form that gets attached to a main form in
I created a script that list the directories in the current directory <?php $dir
I have created a repeat control that list some documents. I would like to
I have a gridview and in that gridview i created a list of imagebuttons
I have a list of items that are created from the results of website
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I created a workflow through Sharepoint Designer 2007 that simply updates a list item
I've created a listview that's filled up with a list of guitars from the

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.