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 WordPress 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 – without using shortcodes.
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 using the Gravity Forms drag and drop form builder. This is where the all of the User Registration information will be collected such as contact information and details about their user role.
Add fields to the drag and drop form builder for every User Registration item you want each new user to supply using the Gravity Forms User Registration Add-On. The minimum requirement is an Email field so users can receive email notifications, but you can add new fields to collect any of the following info: Username, Name/Nickname/Display Name, Email, Password, and User Role (such as ‘Subscriber’). It will look something like this on the front-end:
This works as a registration page with a simple registration process.
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. This is easy with the Gravity Forms User Registration Add-On. 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 new users that are added to the child forms will be registered once the Parent form is submitted. If you want to require the new users activate their user 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. The best part is that you can do all of this without using shortcodes.
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!