Commit 55bc42ecde718de9763fdaae3bb9a7eb520f5692
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control
into pudong
Showing
1 changed file
with
9 additions
and
2 deletions
src/main/resources/static/pages/base/line/js/line-add-form.js
| @@ -94,7 +94,7 @@ $(function(){ | @@ -94,7 +94,7 @@ $(function(){ | ||
| 94 | // 需要验证的表单元素 | 94 | // 需要验证的表单元素 |
| 95 | rules : { | 95 | rules : { |
| 96 | 'name' : {required : true,maxlength: 30},// 线路名称 必填项、 最大长度. | 96 | 'name' : {required : true,maxlength: 30},// 线路名称 必填项、 最大长度. |
| 97 | - 'lineCode' : {required : true,maxlength: 6,digits:true , | 97 | + 'lineCode' : {required : true,maxlength: 6,digits:true ,isLineCode:true, |
| 98 | remote:{type: 'GET', | 98 | remote:{type: 'GET', |
| 99 | url: '/line/lineCodeVerification', | 99 | url: '/line/lineCodeVerification', |
| 100 | cache:false, | 100 | cache:false, |
| @@ -262,7 +262,14 @@ $(function(){ | @@ -262,7 +262,14 @@ $(function(){ | ||
| 262 | } | 262 | } |
| 263 | } | 263 | } |
| 264 | }); | 264 | }); |
| 265 | - | 265 | + |
| 266 | + // 线路编码不能0开头 | ||
| 267 | + $.validator.addMethod("isLineCode", function(value,element) { | ||
| 268 | + // 线路编码正则表达式 | ||
| 269 | + var lineCode = /^([1-9])/; | ||
| 270 | + return lineCode.test(value); | ||
| 271 | + }, "线路编码不能以0开头"); | ||
| 272 | + | ||
| 266 | // 联系电话(手机/电话皆可)验证 | 273 | // 联系电话(手机/电话皆可)验证 |
| 267 | $.validator.addMethod("isPhone", function(value,element) { | 274 | $.validator.addMethod("isPhone", function(value,element) { |
| 268 | // 长度 | 275 | // 长度 |