文件说明:
1.validator.js为验证框架的js文件。
2.index.htm为验证演示文件。
validator.js中的内容说明:
1.原文件中数据比较验证,即 dataType="Compare"验证只是简单的字符比较,并不是真正的数字比较验证。
如:
<input type="text" dataType="Compare" to="18" operator="LessThan" msg="年龄应小于18">
输入120也是正确的。
经过改良后,已经避免了这样的错误,同时扩展了其用法。
一种同上。另一种如下:
<input type="text" id="firstdata">
<input type="text" dataType="Compare" to="firstdata" operator="LessThan" msg="应该小于第一个数">
2.增加时间比较验证,演示文件中有用法。
3.增加时间格式验证。DateTime用法同其他验证一样。
验证功能比原文件的时间验证强,可以说是时间验证的完整版。它可以验证大小月,月份,天数,平年,润年。