I have a form containing some url fields. The issue is that Safari validates html5 input fields BEFORE the user can save a draft og publish a post. When the field is in another tab, the user can’t see that Safari can’t validate the field and the user is stuck :-/
It is the same for email fields.
ACF is set to validate both the email and url fields when the post is published which is great in Chrome.
I would like Safari to do the same: Not validate the fields before submitting the form, so ACF can validate the fields.
Setting “novalidate” on the form works. But how can I set this attribute on a ACF generated form when creating a post? Is there a filter or a setting I can use to make ACF set this attribute on the form?
Use the form_attributes
argument for acf_form()
Hi John,
You are a life saver! Thanks!
One thing I just thought of that you might want to consider is that I think ACF might depend on browser validation is some cases, but I’m not 100% certain of that.
Check. I can see that Safari does some validation that Chrome doesnt. I will keep that in mind and check 🙂
Hi John,
I can see that the acf_form is for a frontend form. What I need is to add novalidate to a form when editing a post in the admin.
I register the field group for the post with acf_add_local_field_group and then ACF generates the form.
Is there a way to add novalidate to this kind of form?