validatebox 的validateType可以是一下3個格式:
1字符串
2數組,應用多個驗證
3對象,每個key是一個驗證名稱value是驗證的數組參數
下面是代碼示例
<input class="easyui-validatebox" data-options="required:true,validType:'url'"> <input class="easyui-validatebox" data-options=" required:true, validType:['email','length[0,20]'] "> <input class="easyui-validatebox" data-options=" required:true, validType:{ length:[10,30], remote:['http://.../action.do','paramName'] } ">
配置了remote會發送一條ajax請求,當返回'true'才會驗證通過了。
如果這篇文章對您有幫助,您可以打賞我