$("#frmAppointment").submit(function (e) {
    var isValid = $(this).valid();
    if (isValid) {
        var isValidCaptcha = grecaptcha.getResponse();
        if (isValidCaptcha == null || isValidCaptcha == "") {
            toastr.error("Please verify that you are human");
            return false;
        }
        else {
            $(this).submit();
            return true;
        }

    }
    else {
        return false;
    }
});

$(document).ready(function () {
    $("#Name").val("");
    $("#Email").val("");
    $("#ContactNo").val("");
    $("#MeetingType").val("Audio/Video Call");
    $("#Message").val("");
    $("#Date").val("");
    $("#Time").val("");

    var today = new Date()
    today.setDate(today.getDate() + 1)

    var maxDate = new Date()
    maxDate.setDate(maxDate.getDate() + 7)


    var ddMaxDate = maxDate.getDate();
    var mmMaxDate = maxDate.getMonth() + 1;
    var yyyyMaxDate = maxDate.getFullYear();
    if (ddMaxDate < 10) {
        ddMaxDate = '0' + ddMaxDate
    }
    if (mmMaxDate < 10) {
        mmMaxDate = '0' + mmMaxDate
    }
    maxDate = yyyyMaxDate + '-' + mmMaxDate + '-' + ddMaxDate;


    var ddToday = today.getDate();
    var mmToday = today.getMonth() + 1;
    var yyyyToday = today.getFullYear();
    if (ddToday < 10) {
        ddToday = '0' + ddToday
    }
    if (mmToday < 10) {
        mmToday = '0' + mmToday
    }
    today = yyyyToday + '-' + mmToday + '-' + ddToday;
    document.getElementById("Date").setAttribute("min", today);
    document.getElementById("Date").setAttribute("max", maxDate);

});