87,917
社区成员
发帖
与我相关
我的任务
分享
$(function(){
$('.search_table input').each(function () {
if ($(this).attr('required') || $(this).attr('validType'))
$(this).validatebox();
});
});
$.extend($.fn.validatebox.defaults.rules, {
num : {
validator : function(value, param) {
var patrn = /^([0-9]|10)$/;
return patrn.test(value);
},
message : '只能输入0-10之间的整数!'
},
}
function submit(){
var str=$(".validatebox-text.validatebox-invalid:first");
if(str.val()==null){
$("#form1").submit();
}else{
alert("请检查带有警告的数据!");
}
}
<input validType="num" required="true" type="text" id="num" name="num"/>
<input type="text" class="easyui-numberbox" value="100" data-options="min:0,max:10">
if(!$("#form").form('validate')){
return false;
}
if(!$("#form").form('validate')){
alert("no");
}else{
alert("yes");
}