Ever wanted to create a simple Gravity Forms user login page without the need of investing into add-ons?
This tutorial will move you through the process of a solid Front End process.
Part 1 – creating a simple login page
First let’s go ahead and set up a simple form with two fields.
- Username (please assign username class to the field)
- Password (please assign password class to the field and make sure the password checkbox is checked)
Once set up with the two embed the form anywhere in the page likewise:
Now, let’s setup two hooks, that will login the user:
- Runs once the form is submitted
- Runs during the form validation
1. Gform after submission hook
This hook fires after the form was submitted and the whole data was validate, we’ll bind it to the form which have just created.
2. Gform field validation hook
This hook fires during the form submission process and iterates over every field.
Once these two were set up (placed anywhere in the functions.php file) we can go ahead and test the form embeded to a page.Â Let’s do some testing:
Â I tried logging in with the wrong password and I failed! This means that the validation is working properly. Let’s go ahead and login with the real credentials – boom I tested it and logged in successfully.
Latest posts by RafaĆ Gicgier (see all)
- WP Doin Recognized among Top Web Developers in Poland - 29 October 2019
- WordPress application development ACF & Gravity Forms - 3 August 2019
- OptiPic.io – How and why to optimize the image on the site? - 8 April 2019