How to make a date field required in webflow form


I have 3 input date picker fields in the webflow form. I added the attributes (type = date; id = ; required = true). But the field is not considered as a required field. Please let me know how to set this?

Site - https://pytf-new-merged-and-improved-site.webflow.io/

Here is my site Read-Only: [ Webflow - PYTF NEW MERGED AND IMPROVED SITE ]

Hey @gopal_aparna ,

Can you check if you have the required = true attribute for the date pickers? I was not able to find the attribute set on the date pickers.

I tested this use-case in a personal dummy site and when I set the required attribute to the custom input element, it does not let me submit the form without selecting the date as shown in the screenshot.

So adding the required = true attribute should work for your site as well. Hope this helps.

1 Like

AJ has it again-

Make sure to scroll past the form information in the settings pane, the custom element attributes are below that [3] and you probably want the required attribute on both of your input type=date fields [2][4].

1 Like

Thanks for the replies. required=true attribute works on submit form.

I got confused with the formly multi-step form feature which doesn’t allow to move to the next step without filling all required fields. There it doesn’t work.

Hey @gopal_aparna ,

In that case, you could setup a default input field and check the ‘Required’ box as usual and have a script to convert it to a date picker.

Here’s a cloneable that you can use for the date picker element, I tested this out with Formly’s multi-step form and the ‘Next’ button becomes disabled until I fill out this date picker input.

Hope this helps.