Adding a warning when trying to close an unsubmitted form in Gravity Forms
Blogging this before I forget it!
I needed to add a warning to a form in Gravity Forms in case someone started filling out a form but forgot to click the submit button before closing the page. I’ve seen plenty of pages do this before, and figured there might be away to easily do something like this in Gravity Forms.
There isn’t a built-in feature in Gravity Forms for this, but it turns out that using jQuery you can easily check if someone has clicked on any of the form inputs, and if they try to close the page throw up a warning.