Registration form required fields for collecting information
Registration, apart form what it does, is also a method for collecting user information. Any registration form, except the most basic ones, will have fields that are required to be filled before being submitted. Email by its very nature is mandatory, since it’s the only bridge for communication between the WordPress site and the registering user. As we have already learned, a WordPress registration form can be easily populated with custom fields which are formatted and validated to collect various bits of user information when submitting the form. Let us now learn to make registration form required fields so that they must hold values when user submits the form or otherwise return error asking user to fill them first.
For this demonstration, we have created a generic form with following fields:
• First Name – WP Profile Field
• Last Name – WP Profile Field
• Date of Birth – Custom Date Field
• Email – Mandatory Email Field
• Marital Status – Radio box field
• Bio – WP Profile Field
Marking a registration form field as required
The form fields looks something like this in our RegistrationMagic dashboard area.
And like this on our front end using Twenty Sixteen theme. The look maybe different depending on your theme.
We need to make first two registration form required fields. For this we have to click on the Edit button on the field bar.
It opens the registration form field settings. On this page, there’s a checkbox with label – Is Required. We need to check it and save, and go on to repeat the process with the second field.
Once we are finished, let’s move to front end and see any difference on our form.
As we can see, red asterisks appear before first the two field labels. This universally signify a required field. Next lets make sure they are doing exactly what they intend to do by trying to submit the form while keeping first two fields blank. Here’s what we’ve got:
Not only the form fails to submit, two notices appear below the first two input boxes telling the user that he or she must fill them for a successful submission. Remember, nobody likes a form that keeps throwing error, and we want the user to get it right first time. Therefore, it’s very useful to add help text to the fields to let user know exactly what information we need.
Adding help text to registration form fields
For this, we are going to do two things 1) Add Placeholder Text 2) Add Help Text to both the fields. We’ll to go back to Registration Form Field settings. Both settings are right below the field Label.
Now the front end of the form appears as:
If we move cursor to the first input box, Helptext appears below it automatically.
Remove asterisks from registration form required fields
Everything is working perfectly now. There’s one more thing – many folks do not want the red asterisks to appear on their forms. RegistrationMagic has an option to serve them as well. We go to Global Settings —> General and scroll down the page to last option. It says Show Asterisk on Required Fields.
By default it is checked. If we uncheck it, save and reload our form:
Voila! No more pesky asterisks.
This ends our short tutorial on adding and managing WordPress registration form required fields. We’ll be back soon with another one very soon.
- Ideas: How to Create Super Intelligent Forms in WordPress - February 8, 2018
- Payments Guide: Setup payments on Registration form using Products - December 22, 2017
- Starter Guide: Setup User Registration System in WordPress - November 14, 2017
- How to Add Custom Fields to WooCommerce Checkout Form - November 3, 2017
- Setup Early Bird Registration for an Event on WordPress Site, with Ease! - April 20, 2017
- Reinvent WooCommerce User Registration Process & Increase Sales! - April 17, 2017
- Auto login user after registration on WordPress site - November 3, 2016
- WordPress registration form required fields – complete guide - November 2, 2016
- WordPress registration not sending Email - October 11, 2016
- How to create custom user registration form page in WordPress? - October 10, 2016