[Skip to main content](#vessel-content)

#   Edit Postal Code to acept only numbers

##

- **[mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")**
- [![mazin07's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/55393-mazin07 "View mazin07's Profile") Topic Author
- [ Offline](/forum/user/55393-mazin07)

Less More

- Posts: 29
- Thank you received: 1
-
-

8 years 8 months ago [\#289039](#289039) by [mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")  *[Edit Postal Code to acept only numbers](/forum/28-shipping-methods/894001-edit-postal-code-to-acept-only-numbers#289039 "-- url of the page with the problem -- :   umbandaexplica.com.br/loja/  -- HikaShop version -- : 3.2.2  Hi there,  I want to know how to make the users put only numbers in the Zip Code field. Currently they can put &quot;12365-5623&quot; &quot;abd2454&quot; and so on.  Thankful.")* was created by *[mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")*

-- url of the page with the problem -- : [ umbandaexplica.com.br/loja/](https://umbandaexplica.com.br/loja/)
-- HikaShop version -- : 3.2.2

Hi there,

I want to know how to make the users put only numbers in the Zip Code field. Currently they can put "12365-5623" "abd2454" and so on.

Thankful.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0MDAxLWVkaXQtcG9zdGFsLWNvZGUtdG8tYWNlcHQtb25seS1udW1iZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 8 months ago [\#289043](#289043) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Edit Postal Code to acept only numbers](/forum/28-shipping-methods/894001-edit-postal-code-to-acept-only-numbers#289043 "-- url of the page with the problem -- :   umbandaexplica.com.br/loja/  -- HikaShop version -- : 3.2.2  Hi there,  I want to know how to make the users put only numbers in the Zip Code field. Currently they can put &quot;12365-5623&quot; &quot;abd2454&quot; and so on.  Thankful.")*

Hello,

You have to use the regular expression check.
See : [ www.hikashop.com/support/documentation/1...ield-form.html#infos](https://www.hikashop.com/support/documentation/10-documentation/hikashop/42-hikashop-field-form.html#infos)

For more details :
[ www.regular-expressions.info/tutorial.html](http://www.regular-expressions.info/tutorial.html)
[ www.hikashop.com/forum/content-creation/...message-to-user.html](https://www.hikashop.com/forum/content-creation/891212-validating-custom-fields-and-showing-message-to-user.html)
[ www.hikashop.com/forum/shipping-methods/...pping-addresses.html](https://www.hikashop.com/forum/shipping-methods/887123-don-t-allow-po-box-shipping-addresses.html)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0MDAxLWVkaXQtcG9zdGFsLWNvZGUtdG8tYWNlcHQtb25seS1udW1iZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")**
- [![mazin07's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/55393-mazin07 "View mazin07's Profile") Topic Author
- [ Offline](/forum/user/55393-mazin07)

Less More

- Posts: 29
- Thank you received: 1
-
-

8 years 8 months ago [\#289099](#289099) by [mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")  Replied by *[mazin07](/forum/user/55393-mazin07 "View mazin07's Profile")* on topic *[Edit Postal Code to acept only numbers](/forum/28-shipping-methods/894001-edit-postal-code-to-acept-only-numbers#289099 "-- url of the page with the problem -- :   umbandaexplica.com.br/loja/  -- HikaShop version -- : 3.2.2  Hi there,  I want to know how to make the users put only numbers in the Zip Code field. Currently they can put &quot;12365-5623&quot; &quot;abd2454&quot; and so on.  Thankful.")*

Hi Jerome, it worked perfectly.

But I made some changes. In the documentation speak to use only [0-9] + but this causes special characters to be used or letters. The code only causes the first character to be a number from 0-9.

I used the following code: ^ [0-9] + $ and it works perfectly. Only numbers, no letters or special characters.

Very Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI4LXNoaXBwaW5nLW1ldGhvZHMvODk0MDAxLWVkaXQtcG9zdGFsLWNvZGUtdG8tYWNlcHQtb25seS1udW1iZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
