如何在没有日期选择器的情况下在联系表 7 中显示今天的日期

How to display the today date in contact form 7 without datepicker

我想在联系表 7 的字段日期中显示当前日期(今天是提交表单的日期)而不使用日期选择器选择它,我还想禁用日期选择器,如果它是 possible.please 求助

你必须添加这个脚本。

<script>
jQuery(function ($) {
   var now = new Date(); 
   var day = ("0" + now.getDate()).slice(-2);
   var month = ("0" + (now.getMonth() + 1)).slice(-2);
   var today = now.getFullYear()+"-"+(month)+"-"+(day);
   $('#MydatePicker').val(today);
   $("#MydatePicker").attr("min", today);
});
</script>

[date* your-date class:required id:MydatePicker] 

请查收。