Regular expression on postal code field not working

  • Posts: 18
  • Thank you received: 1
  • Hikashop Business Hikashop Essential
2 years 4 months ago #342661

-- url of the page with the problem -- : paintmaster.nl
-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0.20
-- Browser(s) name and version -- : all browsers
-- Error-message(debug-mod must be tuned on) -- : no error message

Hi,

I can not get the regular expression to work in "display / custom fields / address_post_cde . The expresson I use is this:

/^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$/i

For dutch postal codes like "1039 AA" and "3224cc"

I have set the field to "Required", but all entries say that it is not a right postal code. Even a very simple regular expression never validates right.

Kind regards,
Peter

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 4 months ago #342663

Hi,

You should only use:

^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$
The / around are added by HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum