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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:08:09+00:00 2026-05-25T02:08:09+00:00

I have a form into which the user can add more fields to fill

  • 0

I have a form into which the user can add more fields to fill by clicking on the “add” anchor (#addLink). However I also have a table with possible data and the purpose of it is so that if the user adds a new row of fields he can click then the row on the table that fits the most and the fields fill themselves. I can’t seem to be able to do this though because I can’t get a function that checks how many fields are and just fills the last one (I have to know how many there are to fill the last one and not replace everything else). The fields were created by another programmer and I don’t have access to that code. He doesn’t give me id’s or classes just names which are of the form “links[n][url]” (where n = a number and the word url literally).

So far I had:

$('#addLink').click(function(){
        //links[n][url]
        var $inputs = $('#links :input'); //#links is a div that contains the fields
        var names = {};

        $inputs.each(function(index){
            alert(index + ' : ' + $(this).attr('id'));
            ids[$(this).attr('name')];
        });
    });

but it just alerts (0 : ); nothing else. What am I missing?

  • 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-25T02:08:09+00:00Added an answer on May 25, 2026 at 2:08 am
    $('#addLink').click(function(){
    
        var inputs = $('#links:input:last'); //#links is a div that contains the fields
        var names = {};
    
    
            alert(inputs.index() + ' : ' + $(inputs).attr('id'));
    
    
    });
    

    Are you just trying to select the last one? :inputs:last

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

Sidebar

Related Questions

I have a form where the user can dynamically add fields (clone and increasing
I have a C# form into which I've placed a left-docked MenuStrip . This
I have a WPF form that uses ClientLogin to log a user into their
i have a form and a sortable() list where a user can drag from
I have default FOSUserBundle registration form. I want to add jabber field into registration
I have a page upon which a user can choose up to many different
I have a form that sends info into a database table. I have it
I have included Zend_Form_Element_Hash into a form multiplecheckbox form. I have jQuery set to
I have a form that is trying to insert some data into an SQL
I have the following code I use to insert form data into a single

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.