Format date dd.mm.yyyy for input text with jQuery Validation addMethod

后端 未结 2 1112
深忆病人
深忆病人 2021-01-22 00:50

I am having real trouble with this addMethod for validating a date from an input. It doesn\'t test the regex properly and i think it may be written with errors. The date should

2条回答
  •  忘掉有多难
    2021-01-22 01:07

    $(function () {
        $.datepicker.setDefaults({
            dateFormat: 'dd/mm/yy'
        });
    });
    
    Then to bind it to the input element:
    $(function () {
        $("#StartDate").datepicker();
    });
    

    Credits Amalea

提交回复
热议问题