Validform表单验证,但没用form提交,而是按钮ajax提交后,验证失效
<script>
$(document).ready(function(){
var demo = $("#register").Validform({
tiptype:2
});
})
</script>
//form内容
<form method="post" id="register">
<div class="left_frame2">
<div class="about_content">修改联系方式</div>
<hr width="350px" color="lightgray" style="margin-left:150px" />
<div class="about_tel"><label>原手机号:</label> <input type="text" class="input-text-1" errormsg="输入格式错误" nullmsg="请输入手机号码" datatype="m" name="tel" id="tel" ajaxurl="/property/tell/user" /></div>
<div class="inline-block"></div>
<div class="about_tel"><label>新手机号:</label> <input type="text" class="input-text-1" sucmsg="通过验证" errormsg="输入格式错误" nullmsg="请输入手机号码" datatype="m" name="tell" id="tell" placeholder="请输入手机号码" /></div>
<div class="inline-block" id="inline1"></div>
<div style="width: 350px;margin-top:-13px;">
<input style="margin:20px 0px 0px 180px; border-style: inset;" type="reset" value="重置" onclick="resets()"/>
<input style="margin:20px 0px 0px 50px; border-style: inset;" type="button" value="保存资料" onclick="sibmits()"/>
</div>
</div>
</form>
//保存资料按钮ajax请求;
function sibmits(){
var tell=$(".left_frame2 .about_tel #tell").val();
$.ajax({
url:"/property/insertUpdate/phone",
type:"post",
dataType:"json",
data:{"tell":tell},
success:function(data){
layer.alert('恭喜您,修改成功', {
skin: 'layui-layer-lan',
closeBtn: 0,
shift: 4 //动画类型
});
$('#register')[0].reset();
},
error:function(){
alert("error");
}
})
}
怎么在ajax中添加一个如果表单验证没通过,不执行的语句啊???