The date picker is supposed to automatically put in today’s date. It works on desktop, but not mobile. Any suggestions? Here’s the form: https://funhebrewschool.org/health/
This is the code I put in the functions.php file:
add_filter( ‘gform_field_value_current_date’, ‘populate_current_date’ );
function populate_current_date( $value ) {
$local_timestamp = GFCommon::get_local_timestamp( time() );
return date_i18n( ‘m/d/Y’, $local_timestamp, true );
}
I also tried it just using the merge tag without the code. Still doesn’t work on mobile.
Any ideas why it doesn’t work on mobile? Thank you!
chrishajer
(Chris (Gravity Forms))
November 4, 2020, 10:39pm
2
Hi Jeanne. When I loaded the phone in Firefox on an iPhone I see the date pre-populated with 10/30/2020. How is that getting in there?
Screenshot: https://d.pr/i/O5jtUg
It defaults to the last day the form was saved.
chrishajer
(Chris (Gravity Forms))
November 4, 2020, 10:53pm
4
Is that intentional? I thought you were trying to populate it with code, but you are saying it is populated with the date the form was last saved?
That happened for me on Desktop and Mobile.
No, I want it to be the date they fill out the form. It was working for me on desktop, but not on mobile. It’s not work for you on both?
I tried it with the merge tag and with code that I found on the forums.
chrishajer
(Chris (Gravity Forms))
November 4, 2020, 10:56pm
6
It is adding that date on desktop and mobile. Gravity Forms does not do it on its own, so I am not sure how that is happening.
I recommend opening a support ticket for the issue: