$.extend($.fn.validatebox.defaults.rules, {
telNum:{ //既验证手机号,又验证座机号
validator: function(value, param){
return /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\d3)|(\d{3}\-))?(1[358]\d{9})$)/.test(value);
},
message: '请输入正确的电话号码。'
},
idcard : {// 验证身份证
validator : function(value) {
return /^\d{15}(\d{2}[A-Za-z0-9])?$/i.test(value) || /^\d{18}(\d{2}[A-Za-z0-9])?$/i.test(value);
},
message : '身份证号码格式不正确'
},
});
<th width="1%" nowrap="nowrap" align="center"><font color="red">* </font>联系电话:</th>
<td width="1%" nowrap="nowrap" align="left">
<input id="phone" name="phone" class="easyui-validatebox input220" type="text" value="${pe.phone}" data-options="required:true,validType:'telNum'"/>
</td>
<th width="1%" nowrap="nowrap" align="center"><font color="red">* </font>身份证号码:</th>
<td width="1%" nowrap="nowrap" align="left">
<input id="idCard" name="idCard" class="easyui-validatebox input220" type="text" value="${pe.idCard}" data-options="required:true,validType:'idcard'"/>
</td>