Resetting Default Value if User Deletes it and Leaves the Field Blank

Hi,

I have a form where the default value is 01/01/1990 because it integrates with a CMS package that needs something to go through. However, users have been deleting the default value which throws off the integration.

I’m guessing that something along the lines of this would be needed:

if Datefield == empty then
insert default date
Endif

But where would you put it?

Is this something that can be done using a function? Or would it need to be included in the form processing PHP?

Hi Peter. How you do this depends on how you are integrating with your CRM. See the post I made about a related issue here:

You might use the gform_after_submission hook to compare the blank fields to the form defaults and “re-populate” the deleted values. As Chris noted, depending on how you integrate to CRM may impact where/when that would apply. As an example, the Gravity Flow outgoing webhook step fires very late in the form processing, generally after all feeds (and the gform_after_submission hooked functions) have performed. It may help you to achieve with a no/low code approach.

Regards,
Jamie

© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.