[email protected]
WordPress Development
  • Home
  • Blog
  • Pricing
  • Urbex
  • FAQ
    • Guest Blogging
    • Cookie Policy
    • Privacy Policy
  • Contact
  • Codeable
  • Recommended WordPress Hosting
    • Kinsta
    • Cloudways
    • WordPress.com
    • Bluehost
Select Page

Gravity Forms Create Front End Login / Register / Edit account – PART 3

by Rafał Gicgier | Oct 22, 2014 | Gravity Forms, Gravity Series Login, Plugin Development | 0 comments

Welcome to the third and last part of the Gravity Forms Front End Login / Register / Edit account series.

In this tutorial we’ll cover the edit account page setup. You can find the related tutorials at: 1st, 2nd.

Part 3 – creating a simple edit account page

Unlike previously the form we’re going to create will be slightly different. First we need to output some data on the form, which will use Gravity Forms dynamic population. This will be bound to the currently logged in user for which we’ll load the data.

Let’s go ahead and create it. We need the following fields:

  1. Email (with the email CSS class assigned, and dynamic population variable set to email)
  2. Old Password (with the old-pass CSS class assigned)
  3. New Password (with the new-pass CSS class assigned)
  4. Repeat Password (with the repeat-pass CSS class assigned)
  5. First Name (with the fname CSS class assigned, and dynamic population variable set to fname)

This form will let us change the associated email address, the password (for which we’ll need to provide a valid current password – safety precaution) and change our First Name.

Gform validation hooks

With all the fields filled we need to validate them before submitting the form. In our case this only applies to the old password, since all other fields need not be validate.

It’s worth nothing the comments added to the functions. We’re using a simple trick here – we’re assigning field validation to a specific form field and then comparing it’s value with a different form – which has a specific CSS class assigned to it!

Gform pre submission hook

Gfrom field value hooks

Now, we need to make sure, that the fields actually list the data provided by the user. Since we’re accessing a predefined values, there are already functions for doing so. Let’s make usage of the global variable $current_user.

Reference links:

http://codex.wordpress.org/Function_Reference/get_currentuserinfo

http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

http://www.gravityhelp.com/documentation/page/Gform_pre_submission

http://www.gravityhelp.com/documentation/page/Using_the_Gravity_Forms_%22gform_validation%22_Hook

Categories

Sponsored Content

The Ultimate Managed Hosting Platform



WooCommerce

COPYRIGHT

Copyright © 2022 WP doin – Rafał Gicgier

INVOICING:
WP DOIN – RAFAŁ GICGIER
Łódź, ul.Henryka Sienkiewicza,
nr 85/87, lok. XI, 8, 90-057
PL7251927749
[email protected]

Recommended ENTERPRISE Hosting

By browsing through the site and filling in the Contact Forms you agree to our PRIVACY POLICY.
Moreover WP doin website uses COOKIES to improve your experience. We assume you're ok with this, but you can opt-out if you wish.
ACCEPT REJECT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT