I have a form for table reservations at a restaurant. I need to block out mondays and I also need to block Xmas Eve and NYE as options… here’s the code which I have added in an html block on the form:
<script>
gform.addFilter('gform_datepicker_options_pre_init', function (optionsObj, formId, fieldId) {
if (formId == 3 && fieldId == 12) {
optionsObj.firstDay = 1;
optionsObj.beforeShowDay = function (date) {
var disabledDays = [’12/24/2018’, ’12/31/2018’],
currentDate = jQuery.datepicker.formatDate('mm/dd/yy', date),
day = date.getDay();
return [!(disabledDays.indexOf(currentDate) != -1 || day == 1)];
};
}
return optionsObj;
});
</script>
the form ID and the field ID are correct - but it’s not working.
I had it working to exclude only Xmas Eve before, but since I have tried to edit I cannot even get that working again.
I’m sure it’s something simple - but I can’t see it. I’ve also deleted the previous block and started again from scratch…
As I posted this I noticed that the date format is mm/dd/yy and yet the year is listed as 2018 - I thought that could be part of the issue - but changing the dates to 12/24/18 made no difference…
Hi Steve. I see you have a support ticket already. I will leave this open here in case anyone wants to comment, but for support we will use the support ticket you opened. Thank you.
Thanks, Chris - that would be great - I can see no way to access the support tickets - and I opened a new one today as the one from last week was answered only to ask for the access codes - nothing appears to have been done, nor did I receive a further reply - I was out of the office for a few days at a conference and was only able to follow up on this today… my client is getting louder!
I see the new ticket for today. We don’t address the concern here but will focus instead on the support ticket. If someone from the community wants to help here, I will leave this open for that purpose. Thanks.