Gravity Forms

Gravity Forms Add-ons

How to use the new No CAPTCHA reCAPTCHA field

Just install the Gravity Forms No CAPTCHA reCAPTCHA plugin.

How to disable past dates on date pickers

Just use this code:

<script>
    $(function (){
        $(".datepicker").datepicker({ minDate: 0 });
    });
</script>

Don’t forget to set the correct date format, because it will change due to datepicker function.

How to change the date format globally

<script>
    $(function (){
        $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' });
    });
</script>

How to disable specific weekdays

$(".datepicker").datepicker('option','beforeShowDay',disableSpecificWeekDays);

function disableSpecificWeekDays(date) {
    // 0 = monday, 1 = tuesday, 2 = wednesday, 3 = thursday,4 = friday, 5 = saturday, 6 = sunday
    var daysToDisable = [2, 4, 5];
    var day = date.getDay();
    for (i = 0; i < daysToDisable.length; i++) {
        if ($.inArray(day, daysToDisable) != -1) {
            return [false];
        }
    }
    return [true];
}

Post A Comment

Anti-Spam Quiz: