Skip to content

Conversation

jameslouiz
Copy link

Rewrote the postcodeUK method to filter out more invalid postcodes.

Old one allows integers between 5-7 digits which is not valid.

New one is still case insensitive and allows spaces & fixes the above issue.

@jzaefferer
Copy link
Collaborator

Great, thanks. Could you add a unit test for this as well? Take a look at the existing tests in tests/methods.js.

@jameslouiz
Copy link
Author

I need to amend this request i need to pass in 'value' not 'postcode'. My IDE must not have saved this changed when I commit..

My bad..

@jameslouiz jameslouiz closed this Mar 12, 2013
@jameslouiz jameslouiz reopened this Mar 12, 2013
@jzaefferer
Copy link
Collaborator

That part looks fine to me.

ok( method( "A99 9AA" ), "Valid postcode" );
ok( method( "AA9 9AA" ), "Valid postcode" );
ok( method( "AA99 9AA" ), "Valid postcode" );
ok(!method( "AAAA 9AA" ), "Invalid postcode" ); // Channel Island
Copy link
Author

Choose a reason for hiding this comment

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

These are a non standard UK postcode and does not follow rest of UK

@jameslouiz
Copy link
Author

Any word on its implementation?

@jzaefferer
Copy link
Collaborator

Yes, just landed, thanks! I've squashed into a single commit, updated the commit message and removed some trailing whitespace.

ruado1987 pushed a commit to ruado1987/jquery-validation that referenced this pull request Mar 22, 2013
…loses jquery-validation#682

Old one allows integers between 5-7 digits which is not valid.

New one is still case insensitive and allows spaces & fixes the above issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants