Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Brandon Brigham
Brandon Brigham
3,716 Points

Gravity Forms Customization

I am using Gravity Forms for WordPress:

So just like email fields come with a second field asking for confirmation, I was wondering how could I create a custom field that needs a confirmation as well.

Example:

I want my client to enter their social security number in a field but then be asked to confirm their social security number by adding it again.

Thank you for your help.

1 Answer

Derek Merson
Derek Merson
19,280 Points

http://gravitywiz.com/custom-field-confirmation/

```// register field IDs 1 and 2 on form ID 8 register_confirmation_fields(8, array(1, 2));

Basically just make two identical fields and then use the above code in your functions.php file, making sure to substitute the id values.
Brandon Brigham
Brandon Brigham
3,716 Points

Hey Derek,

Thanks for the reply -

So I tried your solution but I think I may have done something wrong.

Two fields I have:

Social Security (ID: 17) Social Security Confirm (!D: 32)

Form ID: 1

So according to your code I did this

// register field IDs 17 and 32 on form ID 1 register_confirmation_fields(1, array(17, 32));

Thanks for your time and help