Registering a user when submitting a Gravity Form is easy with the Gravity Forms User Registration Add-On. Simply map a couple of fields and any form instantly turns into a user registration form. If the form already serves another purpose, adding user registration to it streamlines users interaction on your site. What would have taken two forms now only requires a single form.
In this tutorial, we’re going to take this streamlining a step further with the power of GF Nested Forms to build a form that can register multiple users with a single form.
Let’s get started.
- Create a Child Form.
- Add a User Registration Feed.
- Create a Parent Form.
- Add a Nested Form Field to the Parent Form.
We’ll start by creating a Child Form. This is where the all of the User Registration information will be collected.
Add fields for every User Registration item you want each new user to supply. The minimum requirement is an Email field, but you can add fields to collect any of the following info: Username, Name/Nickname/Display Name, Email, Password, and Role.
Once you have created all of the fields for your form, navigate to Settings > User Registration to add the User Registration feed and map your fields.
Now that your child form is finished, it’s time to create the Parent form that will contain it. The fields you add to the Parent form will only appear once, so they should be used to collect values that aren’t unique per user.
Add a Nested Form field on the Parent form and select your child form in the field settings.
Select which fields from the child form should be displayed in the Nested Form field on the Parent form.
When a user fills out the Parent and Child forms, any users that are added to the child forms will be registered once the Parent form is submitted. If you want to require the users activate their account before registration is complete, check the box in the User Registration Feed you set up above.
If you want to take complete control over that activation process, check out GF Better User Activation.
Taking It Further
If your user registration has a cost associated with it, you can take this one step further by including the Nested entry totals in the Parent form. Follow the steps in our documentation to get started.
A common use case for a multi-user registration form is registering a team, similar to our demo in GF Nested Forms documentation. If you’re building a similar form and want to offer different prices based on the player’s age, have a look at our Age Based Pricing article.
Do you have questions or comments about this tutorial? We’d love to hear them!