Skip to content

Create postalcodeIT.js #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Create postalcodeIT.js #1107

wants to merge 3 commits into from

Conversation

endelwar
Copy link
Contributor

@endelwar endelwar commented May 5, 2014

Simple regex that matches italian postal code (CAP), which is made of 5 digit

@@ -0,0 +1,4 @@
/* Matches Italian postcode (CAP) */
jQuery.validator.addMethod("postalcodeIT", function(value, element) {
return this.optional(element) || /^[0-9]{5}$/.test(value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[0-9] should probably be replaced with \d

@endelwar
Copy link
Contributor Author

endelwar commented May 5, 2014

yes, make a lot of sense

@nschonni nschonni added MERGE ME and removed MERGE ME labels May 5, 2014
@jzaefferer jzaefferer closed this in 3c38ff5 May 6, 2014
@jzaefferer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants