- Posts: 22
- Thank you received: 2
Regular expression on postal code field not working
- remcovolbeda
-
Topic Author
- Away
Less
More
4 years 3 months ago #342661
by remcovolbeda
Regular expression on postal code field not working was created by remcovolbeda
-- 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
-- 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.
4 years 3 months ago #342663
by nicolas
Replied by nicolas on topic Regular expression on postal code field not working
Hi,
You should only use:
The / around are added by HikaShop.
You should only use:
Code:
^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$
Please Log in or Create an account to join the conversation.
Time to create page: 0.190 seconds