MinDate & MaxDate

Home Forums Quform WordPress MinDate & MaxDate

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

    I’m trying to set the Datepicker to only allow date selection 2 days from today and max days is one month from today. Is this possible? I add the following code in HTML field but the calendar completely disappear. Im noob so please help me. Thanks in advanced.

    <script>
    jQuery(document).ready(function ($) {
    $('.iphorm_1_9')
    .attr('placeholder', 'dd/mm/yyyy')
    .datepicker({
    dateFormat: 'dd/mm/yy' ,
    minDate: '+2d' ,
    maxDate: '+1m'
    });

    var themeUrl = iphormL10n.plugin_url + '/js/jqueryui/themes/smoothness/jquery-ui-1.8.24.custom.css';
    $('head').append('<link id="iphorm-jqueryui-theme" rel="stylesheet" href="' + themeUrl + '" type="text/css" />');
    });
    </script>

    #19799
    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.

    #19802
    dinmix
    Participant

    Thanks Ally,

    Yes I wanted a Single Line text datepicker field. Anyway, I just managed to get it to work by adding them in the following. I’m not sure if this is the correct way of doing things but it work for me.

    .datepicker({ minDate: '+2D' , maxDate: '+1M', dateFormat: 'dd/mm/yy' });

    #19818
    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