Force users to use the Calendar date picker

I have a couple of date fields on my form where I'm wanting to prevent users from manually entering the dates i.e. force them to select the date using the calendar picker. Is this possible?

Hello @Kyle,

Welcome to plumsail Community!

You can try out this code to disable manual user input:

$(fd.field('Field1').$el).find("input[data-role='datepicker']").attr("readonly", true)

But you will also need to apply CSS to change the field appearance. Add class to the field, e.g. my-class, and test this:

.fd-form .my-class .form-control:disabled,
.fd-form .my-class .form-control[readonly] {
    background-color: #ffffff;
}

Hi Margo, thanks that worked

1 Like