Home › Forums › Quform WordPress › Getting day for conditional logic
- This topic has 3 replies, 2 voices, and was last updated 4 years, 1 month ago by Ally.
- AuthorPosts
- October 5, 2020 at 10:17 am #32023metaphaseParticipant
Hi
I am using a form for appointment booking.
Shop is closed on Sundays
I use the JS below to get the day (supplied by you I think) to check for Sunday selection.Every page of the website has a button with a popup booking form, and this JS and logic works great. I display a message if Sunday is selected.
But, I have one page that has both the popup form button AND the same form in the actual page itself. And on the page form this logic does not work.
Any ideas? Will it break if a page has both popup and embedded version of the form on it?
Thanks
JS:
jQuery(function ($) {
var $dateField = $(‘.quform-field-1_11’),
$hiddenField = $(‘.quform-field-1_23’),
datePicker = $dateField.data(‘kendoDatePicker’);function setDayValue()
{
var value = datePicker.value();if (value instanceof Date) {
$hiddenField.val(value.getDay()).change();
} else {
$hiddenField.val(”).change();
}
}if (datePicker) {
datePicker.bind(‘change’, setDayValue);
$dateField.on(‘blur’, setDayValue);
}
});October 5, 2020 at 10:45 am #32027AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 5, 2020 at 10:50 am #32028metaphaseParticipantThat works. Thanks so much!
I have 30 licenses of Quform and I will continue to use it on every project I build. Great support.
Thanks again
October 6, 2020 at 9:47 am #32034AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.