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

  • Home
  • SEARCH
  • 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 9154019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:21:52+00:00 2026-06-17T12:21:52+00:00

I am quite new with jQuery and I don’t know how to implement this

  • 0

I am quite new with jQuery and I don’t know how to implement this scenario.

For example if I have a form with two text boxes in a raw Name and Email. At the right is a plus button where user can press and another raw will be created bellow with two fields Name and Email, the second raw will have at the right an X button that user can click and that raw will be deleted.

Name: _____ Email: _______ +

Name: _____ Email: _______ X

Name: _____ Email: _______ X

Name: _____ Email: _______ X


  • SAVE –

At the bottom of the form there is a Save button. And when user press it the values from all boxes are take and saved … that is not a problem.

My problem is how should I implement the dynamic fields and pick the values from the fields when I press save?

  • 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-17T12:21:53+00:00Added an answer on June 17, 2026 at 12:21 pm

    DEMO
    Try this code:

       $(document).on("click",".add",function(){
           //take the id
           var id = parseInt($(this).attr('id').substr(4));
           id = id+1;
           //add new row I don't know if you have a table or div layout
    
           $(this).after('<p><input type="text name="name_'+id+'" id="name_'+id+'"/> <input type="text" name="email_'+id+'" id="email_'+id+'"/><input type="button" id="remove_'+id+'" class="remove" value="X"/><input type="button" class="add" id="add_'+id+'" value="+" /></p>');
        });
        $(document).on("click",".remove",function(){
           //take the id
           var id = $(this).attr('id').substr(7);
           //delete
           $("#name_"+id).remove();
           $("#email_"+id).remove();
           $("#add_"+id).remove();
           $("#remove_"+id).remove();
        });
    

    your html

      <p><input type="text name="name_1" id="name_1"/> <input type="text" name="email_1" id="email_1"/><input type="button" id="add_1" value="+" /></p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question is quite basic but I am new to JQuery and
I'm quite new to jQuery so don't jump me if this sounds stupid. I
Ok, so I'm quite new to jQuery, but found this bizzare problem just now,
[I am quite new to jQuery so don't blame me if I get something
I'm quite new to jQuery so this may be a "Seriously, dude?" type of
I'm still quite new to javascript and JQuery...How do I get this div to
I have a form containing some dynamic elements. These are basically text input boxes
Consider this: Math.__proto__.eps=1e-16; jQuery(document).ready(function() { var chart = new Highcharts.Chart({ //... }); }); Quite
I am quite new to jQuery, so my apologizes if there's something obvious I
I'm quite new to jQuery, and I've written a simple function to check 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.