Recent searches


No recent searches

Can I restrict Date Field choices on a Help Center Form?

Answered


Posted Mar 23, 2023

I'm using a form in my help center with 2 date fields - a start date and an end date. As is, end users can pick any dates they like in these fields. Can I restrict their choices to ensure the Event End Date is after the Event Start Date to prevent errors? Can I require the Event Start Date be at least x days after today?



0

2

2 comments

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

Hi Andrew,
 
There aren't any admin settings that would accomplish this, so the only way would involve customization of your Help Center theme.  Adding custom Javascript validation to the form to accomplish this can be a bit tricky due to the way the form's submission process works.  If you're interested customization, you can try a strategy of disabling the submit button until the start and end date form input values meet the constraints you've outlined here in your post.  
 
The form input fields have an ID of requestcustomfields_<ticket_field_id> (where <ticket_field_id> is the ID of the field in your ticket field settings).  Your custom code can leverage that fact to locate the form fields and the values it needs to check.
 

0


0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post