jsp:
<td align="right"><span style="font-size:12px;">身份证号</span></td>
<td><input style="width:200px;height:25px;"name="identityId" id="identityId" class="easyui-validatebox" validType="youthIdentity" required="true" /></td>
js:
youthIdentity:{ validator : function(identityId){ var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; if(reg.test(identityId) === false) { message : '身份证输入不合法' return false; } var vali=true; $.ajax({ url:basepath +'youth/checkAddYouth.do', async: false, processData: false, data: "identityId="+identityId, success: function(responseText){ var result = eval("(" + responseText + ")");//转换为json对象 vali=result.success; console(responseText.data); } }); return vali; }, message : '身份证号已存在或格式错误,请检查!' },
后台:
java
//增加青年,判断数据库是否已经存在系统身份证的青年 public void checkAddYouth(){ try { BaseDao dao = getDao(); int count = (Integer) dao.selectObject("youth.getListIdentityId", model); String s=null; //count!=0 表示已存在 if(count!=0){ s="身份证号已存在"; this.setSuccess(false); }else{ s="身份证号可用"; this.setSuccess(true); } this.setData(s); this.send(); } catch (Exception e) { e.printStackTrace(); this.setData("操作失败"); this.setSuccess(false); this.send(); } }
sql:
<select id="getListIdentityId" parameterClass="youth" resultClass="java.lang.Integer">
select count(1) from ybc_youth a
<dynamic prepend="where">
<isNotEmpty prepend="and" property="identityId">
identityId = #identityId#
</isNotEmpty>
</dynamic>
</select>
相关推荐
解决使用tab布局过程中页面多次加载的问题 如果在使用easyui过程中,你使用了easyui 的tab布局,在tab布局的内容上使用的不是content,而是iframe,那么你的页面有可能多次加载了,这篇文章帮你解决问题
解决easyui-datebox日期格式,只需引入此包即可,不需改源码
easyUI 1.3.5 文档API CHM格式
菜单栏分两级,用户可多个角色,显示通过JSON格式化展示,按钮是用shior标签权限控制
jquery+easyui的说明,chm格式的
easyui textbox失去焦点事件及获取文本框的内容easyui textbox失去焦点事件及获取文本框的内容easyui textbox失去焦点事件及获取文本框的内容
easyUI最新完整项目及资料
Easyui格式化日期的代码,经常用,所以总结出来了
编写js方法,将一般的json格式数据转为easyui treegrid使用的json格式 ............
easyUI,时间控件,解决时间格式化问题
jquery easyui1.2.5版本,及chm格式教程,doc培训文档
包含easyUI 的api,以及实例代码,基于java,让你轻松学会easyUI
用于easyUI实现一些样式及调用的js所需js及css
easyui\easyui-accordion-demo.zip easyui\easyui-crud-demo.zip easyui\easyui-datagrid10-demo.zip easyui\easyui-datagrid11-demo.zip easyui\easyui-datagrid12-demo.zip easyui\easyui-datagrid13-demo.zip ...
easyUI 加载parent/child节点到tree 转换tree标准格式数据 easyUI 创建一个基础的TreeGrid easyUI 创建复杂TreeGrid Form easyUI 通过ajax的方式提交Form easyUI 添加ComboTree 字段到一个 form easyui ...
jquery easyui 中文版api,chm格式,大家可以下载使用下
easyui tree demo简单又牛逼的异步tree, easyui tree demo简单又牛逼的异步tree,easyui tree demo简单又牛逼的异步tree
从数据库里查询到的数据通过递归拼接成EasyUI所需要的json格式纯方法代码,有注释
jqueryEasyUI 下载,及api下载 jqueryEasyUI 下载,及api下载
easyUI拓展:获取当前datagrid中在编辑状态的行编号列表,直接使用即可