Getting day for conditional logic

Home Forums Quform WordPress Getting day for conditional logic

This topic is: resolved
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32023
    metaphase
    Participant

    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);
    }
    });

    #32027
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32028
    metaphase
    Participant

    That 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

    #32034
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy