AndyEmery
Design Dabbler

How do I do a postcode validation in a control on a from?

Jump to solution

Hi There, I have created a form where I am asking the user to input a postcode, how do I validate the field to ensure it is a genuine Postcode format for the UK?

 

I am using NWC

 

Thanks

0 Kudos
Reply
3 Replies
SimonMuntz
Nintex Employee
Nintex Employee

Re: How do I do a postcode validation in a control on a from?

Jump to solution
Hi,
Because of the amount of combinations that a UK postcode can have this may be a little difficult. I looked at using a Text Mask but that won't work. Cant really see how to impliment a regular expression validation.
0 Kudos
Reply
Chris_Ben
Automation Master
Automation Master

Re: How do I do a postcode validation in a control on a from?

Jump to solution

Here are some suggestions in stackoverflow but none are comprehensive - including the regex suggested by the UK Government themselves!  https://stackoverflow.com/questions/164979/regex-for-matching-uk-postcodes

0 Kudos
Reply
butlerj
Community Manager Community Manager
Community Manager

Re: How do I do a postcode validation in a control on a from?

Jump to solution

@AndyEmery looks like this regular expression should do the trick: 

^[A-Z]{1,2}[0-9][A-Z0-9]? ?[0-9][A-Z]{2}$

View solution in original post

0 Kudos
Reply