Home >Web Front-end >JS Tutorial >EasyUI Datebox date verification start date is less than end time example sharing
This article mainly introduces the EasyUI Datebox date verification that the start date is less than the end time. Friends who need it can refer to it. I hope it can help everyone.
Effect
Create date box
<p style="width:65px;"><label>选择时间:</label></p> <p style="width:100px;" id="StartsTime"> <p class="easyui-datebox" name="data" id="StartDate" style="height:26px;width:100px "></p> </p> <pstyle="width:110px;" id="EndTime"> - <p class="easyui-datebox" type="text" name="data" id="EndDate" style="height:26px;width:100px " validType="end"></p> </p>
Custom easyui verification
//验证开始时间小于结束时间 $.extend($.fn.validatebox.defaults.rules, { end: { validator: function (value, param) { var startDate = $("#StartsTime input").val(); var startTmp = new Date(startDate.replace(/-/g, "/")); var endTmp = new Date(value.replace(/-/g, "/")); return startTmp <= endTmp; }, message: '结束时间要大于开始时间!' } })
Related recommendations:
How to solve the problem of hidden or unavailable Easyui-Datebox settings
jQuery EasyUI API Chinese Documentation - DateBox Date Box
jQuery EasyUI API Chinese Documentation - DateBox Date Box_PHP Tutorial
The above is the detailed content of EasyUI Datebox date verification start date is less than end time example sharing. For more information, please follow other related articles on the PHP Chinese website!