APIs & Integrations

ironshield
Participant

Manually attach datepicker (Pikaday) in form

I'm trying to prevent hsforms from using the HTML5 date fields. But I've been unable to override that behavior in Chrome.

In the onFormReady callback, I change the field type to "text". But I haven't found a way to execute the "setupPikaday" method. I can copy most of the code out of the function, and it sorta works. But it would be waaaaay easier if I could tap into the work already done in the hsforms js.

The only other thing I can think to try is to somehow hijack the "isBrowserCompatibleWithNativeDatePicker" method and force it to always return false.

0 Upvotes
1 Reply 1
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Manually attach datepicker (Pikaday) in form

Hi @ironshield,

It might be best to use a custom form and submit to the forms API in this case. The form embed code customization options are intended to provide some additional functionality, but for complete control over your forms the forms API is still the best option.

0 Upvotes