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
meridith albert
488 PointsHow can I add a popup confirmation to Gravity Forms?
Rather than redirecting the user to another page or just displaying plain text I would like to add a popup or overlay confirmation to gravity forms upon submission. However, because I am a novice, I don't know which code is best or where I should place the code. Where can I go to learn how to do this?
2 Answers
Stephen Van Delinder
21,457 PointsMeridith,
I'm not seeing any plugins that do that which means you'd need to build it yourself. I don't know if I would describe building this feature as a "novice" project, but you could absolutely do it. There are three things that you really have to know about to implement a solution like that.
Number one: WordPress Actions and Filters are how WordPress knows when to do what. This is the first step is to add a filter that overrides the redirect behavior and instead call a function that implements the response you want. In this case, the filter would call a function that returns a jQuery script. The other thing you'd need to have a grasp on is css to ensure that your popup renders correctly.
The good news is that there's no need to code it entirely from scratch -- this guy already did it and put his code on github. I'd start with that and modify from there.
Hope this helps!
Stephen Van Delinder
21,457 PointsNo problem -- If you're up for a challenge, build it into a plugin and submit it to WordPress. Then I won't have to build it later ;)
Good luck.
meridith albert
488 Pointsmeridith albert
488 PointsStephen, Thanks so much for your help! This gives me a solid starting point. -Meridith:)