复制代码 代码如下:
<form id="myForm" method="post">
<table align="center" style="width:400px;height:auto;margin-top: 20px">
<tr>
<td align="right">命令:</td>
<td><input id="cmd" name="cmd" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能为空"/></td>
</tr>
<tr>
<td align="right">描述:</td>
<td><input id="depict" name="depict" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能为空"/></td>
</tr>
<tr>
<td align="right">类型:</td>
<td><input id="type" style="width: 200px" class="easyui-validatebox"
url="data/editHealthCheckCombobox_data.json" valueField="id"
textField="text" /></td>
</tr>
<tr>
<td align="right">分数:</td>
<td><input id="score" name="score" style="width: 200px" valueField="number"/></td>
</tr>
<tr>
<td align="right">使用状况:</td>
<td><input id="isUse" style="width: 200px" class="easyui-validatebox"/></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</td>
</tr>
</table>
</form>
复制代码 代码如下:
//表单提交
$('#myForm').form({
url:'/ProcessServlet',
onSubmit:function(){
return $(this).form('validate');
},
success:function(data){
alert(data);
}
});
<form id="myForm" method="post">
<table align="center" style="width:400px;height:auto;margin-top: 20px">
<tr>
<td align="right">命令:</td>
<td><input id="cmd" name="cmd" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能为空"/></td>
</tr>
<tr>
<td align="right">描述:</td>
<td><input id="depict" name="depict" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能为空"/></td>
</tr>
<tr>
<td align="right">类型:</td>
<td><input id="type" style="width: 200px" class="easyui-validatebox"
url="data/editHealthCheckCombobox_data.json" valueField="id"
textField="text" /></td>
</tr>
<tr>
<td align="right">分数:</td>
<td><input id="score" name="score" style="width: 200px" valueField="number"/></td>
</tr>
<tr>
<td align="right">使用状况:</td>
<td><input id="isUse" style="width: 200px" class="easyui-validatebox"/></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</td>
</tr>
</table>
</form>
复制代码 代码如下:
//表单提交
$('#myForm').form({
url:'/ProcessServlet',
onSubmit:function(){
return $(this).form('validate');
},
success:function(data){
alert(data);
}
});
标签:
Jquery,easyUi验证
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“Jquery插件easyUi表单验证提交(示例代码)”评论...