Creating User Registration FormsPro
Freeform allows you to easily create and manage beautiful User registration forms in only minutes! Using the Elements integration, you can enhance your forms with 1-click to enable AJAX, set conditional field logic to show and hide fields, confirm emails and passwords, add Captchas and send custom email notifications! Pair with Payments and you can even accept one time or recurring subscription payments for membership! Leave the heavy lifting to Freeform!
Instructions
This feature requires a Craft Pro license in order to work, as Users are a Craft Pro feature.
1
Prepare the Form
- Create a new form in Freeform. We'll call it
User Registration
. - Use existing Freeform fields and create a new ones as you see fit. Drag and drop them into place in the center Layout column of the form builder. A common registration form might have the following (but not limited to):
- First Name
- Last Name
- Username
- Email Address
- Confirm Email Address
- Use the Confirm field type to set this up.
- Password
- Use the Password field type for this. It will NOT save any password data in the Freeform database tables.
- Confirm Password
- Use the Confirm field type to set this up.
- Photo
- Use a Freeform File Upload field type to set this to map to the User Photo.
- A checkbox to agree to terms and conditions
- Submit button
2
Set up the Connection
- Click on the chain icon button in the Property Editor column at the top right.
- For the Type dropdown, select Users.
- For the User Group dropdown, select the user group you'd like to map to.
- Only user groups that have NO admin permissions will show up as options here.
- If you'd like new users created from Freeform submissions to not yet be activated (and receive the Craft User Activation email) when submitted, check the Activate users? checkbox.
- If you wish to have users automatically logged in upon success, please be sure to use the
'autoLoginAfterAccountActivation' => true,
config item in your Craft config file, and check the Activate users? checkbox.2.5.0+
- If you wish to have users automatically logged in upon success, please be sure to use the
- Map compatible Craft fields to Freeform fields in the Field mapping table.
- There are some obvious limitations with field mapping, as Freeform does not have anything like a Matrix or Table field, etc. Most traditional fields that are similar to each other should be able to correctly map to each other however. We'll likely have an official list of mapping abilities in the near future.
Once that's all finished, you'll have something that looks like the screenshots below. Check out your form in the Freeform demo templates and see if everything works correctly.
Finished!
Important Notes
- Freeform submissions can map to sections with autogenerated titles. Just make sure to set the fields you're using to map to Craft fields that populate the title field to be required on Freeform's end, otherwise the submission likely won't generate the Craft Entry if data for the title is missing.
- Freeform attempts to route User-based errors to the mapped fields. In some cases you might see more than 1 error for a Freeform field because of this. The fields that are mapped to essential fields like username, email and password will mention that "Email cannot be blank", etc.
- While multipage forms do appear to map correctly to users, you may see some slightly unusual behavior. For example, if you have your Password field placed in the second page, when submitting from the first page to the second page, the second page will highlight the field mapped to the Password field highlighted with an error. The whole process still works, but there's that visual issue.
- If the submission is blocked or flagged as spam, there's currently no way to retroactively map submission data to Users. The best option for avoiding this would be using reCAPTCHAPro.