格式化日期
<script type="text/javascript"> $(function () { $("#dd").datebox({ required: "true", missingMessage: "必填项", formatter: function (date) { var y = date.getFullYear(); var m = date.getMonth() + 1; var d = date.getDate(); return y + "-" + (m < 10 ? ("0" + m) : m) + "-" + (d < 10 ? ("0" + d) : d) + "日"; } }); }); </script>
禁止用户输入(readonly属性直接设置不好使,需要加载后通过属性设置)
<input id="dd" class="easyui-datebox" editable="false" required="true"></input>