Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit165005d

Browse files
johana-starjzaefferer
authored andcommitted
Verify nine-digit zip codes.Closesjquery-validationgh-726
1 parent72f179f commit165005d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎additional-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jQuery.validator.addMethod("ziprange", function(value, element) {
5454
},"Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
5555

5656
jQuery.validator.addMethod("zipcodeUS",function(value,element){
57-
returnthis.optional(element)||/\d{5}-\d{4}$|^\d{5}$/.test(value);
57+
returnthis.optional(element)||/^\d{5}-\d{4}$|^\d{5}$/.test(value);
5858
},"The specified US ZIP Code is invalid");
5959

6060
jQuery.validator.addMethod("integer",function(value,element){

‎test/methods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ test("zipcodeUS", function() {
959959
varmethod=methodTest("zipcodeUS");
960960
ok(method("12345"),"Valid zip");
961961
ok(method("12345-2345"),"Valid zip");
962+
ok(method("90210-4567"),"Valid zip");
962963
ok(!method("1"),"Invalid zip");
963964
ok(!method("1234"),"Invalid zip");
964965
ok(!method("123-23"),"Invalid zip");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp