• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

Form to handle multiple entries

I have a form with 12 fields. This form submits the information for registering a student for courses that we offer. Currently, it only handles one registration at a time and is kind of clunky.

I want to present the user the capability to register more than one person at a time. Essentially adding multiple users' info at once before submitting the form.

I also want to have an area above the form that shows a list of people that they enter in a select, which will later be modified to have checkboxes so they may remove them, if needed.

Anyone know of any tutorials or sample showing how to do something like this using jQuery?
Eddie Shipman
Eddie Shipman
  • 3
  • 2
1 Solution
<div id="I_WANT_TO_BE_CLONED" style="display:none">
here all the fields for a registration. It should be the content of your current form

you add a button to add a new user registration somwhere in your page:

<input type="button" id="ADD_NEW_USER_REGISTRATION" value="ADD USER REG" />

your form is by default empty (or with one user reg. if you want)

now we need to clone thediv and put it (add it) add the end of your form
additionaly, we need to unhide (show()) the cloned version :

$("#ADD_NEW_USER_REGISTRATION").click(function(e) {

Open in new window

BASIC TEST PAGE : http://jsfiddle.net/Qewnb/

Eddie ShipmanAll-around developerAuthor Commented:
How would you deal with multiple form fields with the same name in this circumstance?
each set of fields (a user reg.) is inside a div
on the server side, you get an array of fields for a given name
you just need to loop over it for each one

you don't have multiple forms, just one
we've an empty form
a set of fields outside this form
each time we click on the button, we clone the set of fields to add to the form
Eddie ShipmanAll-around developerAuthor Commented:
I an not sure that you would get an array of fields if they had the same name unless they were named name="field_xxx[]"
I understand that there is only one form. Look at how these do it:


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now