layui 设置日期控件不能手动输入,必须选择时间

阅读 67

2022-01-27

因为业务需求,只能选择不能输入。

html:
<input type="text" name="end_time" placeholder="结束时间" class="layui-input" id="end_time" onfocus="this.type='text'" autocomplete="off" style="display:inline-block;width:250px;" readonly >

js:
laydate.render({
    elem: '#end_time', //指定元素
    type: 'date',
    trigger: 'click',
    min: '<?php echo date('Y-m-d',strtotime('+1 day'));?>',//最小起始时间
});

爱资料工具-好用的在线工具箱icon-default.png?t=M0H8https://www.toolnb.com/

精彩评论(0)

0 0 举报