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

#   Validating custom fields and showing message to user

##

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

Less More

- Posts: 42
- Thank you received: 0
-
-

9 years 4 months ago [\#274327](#274327) by [Veli](/forum/user/51285-veli "View Veli's Profile")  *[Validating custom fields and showing message to user](/forum/32-content-creation/891212-validating-custom-fields-and-showing-message-to-user#274327 "-- HikaShop version -- : 3.1.1. -- Joomla version -- : 3.7 -- PHP version -- : 7 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hi, have made several custom fields and have seen it is possible to validate with for example &#91;0-9&#93; and this is working well. However, I have measurements in these fields and these should not be bigger than 320 (for example). With Calc Builder I can make validations, but I do not know how to show a message to the user (front end). I have seen in the field table that you have 'errormessage' but how do I trigger this, if at all possible from my validation in calc builder, or how do I validate a field directly in Hikashop custom Fields such that a value entered there is lower than a certain figure? Hope you can help! Thanks")* was created by *[Veli](/forum/user/51285-veli "View Veli's Profile")*

-- HikaShop version -- : 3.1.1.
-- Joomla version -- : 3.7
-- PHP version -- : 7
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : none

Hi,
have made several custom fields and have seen it is possible to validate with for example [0-9] and this is working well. However, I have measurements in these fields and these should not be bigger than 320 (for example).
With Calc Builder I can make validations, but I do not know how to show a message to the user (front end).
I have seen in the field table that you have 'errormessage' but how do I trigger this, if at all possible from my validation in calc builder, or how do I validate a field directly in Hikashop custom Fields such that a value entered there is lower than a certain figure?
Hope you can help!
Thanks

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

9 years 4 months ago -  9 years 4 months ago [\#274343](#274343) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Validating custom fields and showing message to user](/forum/32-content-creation/891212-validating-custom-fields-and-showing-message-to-user#274343 "-- HikaShop version -- : 3.1.1. -- Joomla version -- : 3.7 -- PHP version -- : 7 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hi, have made several custom fields and have seen it is possible to validate with for example &#91;0-9&#93; and this is working well. However, I have measurements in these fields and these should not be bigger than 320 (for example). With Calc Builder I can make validations, but I do not know how to show a message to the user (front end). I have seen in the field table that you have 'errormessage' but how do I trigger this, if at all possible from my validation in calc builder, or how do I validate a field directly in Hikashop custom Fields such that a value entered there is lower than a certain figure? Hope you can help! Thanks")*

Hi,

You can do that with the regex check. It's just a bit more complex: Code:

(320&#124;3[0-1][0-9]&#124;[1-2][0-9][0-9]&#124;[0-9][0-9]&#124;[0-9])

This reads as:
- 320 or
- a text with 3 followed by 0 or 1 and then another number or
- a text with 1 or 2 followed by two numbers or
- a text with two numbers or
- a text with one number

Last edit: 9 years 4 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

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

Less More

- Posts: 42
- Thank you received: 0
-
-

9 years 4 months ago [\#274391](#274391) by [Veli](/forum/user/51285-veli "View Veli's Profile")  Replied by *[Veli](/forum/user/51285-veli "View Veli's Profile")* on topic *[Validating custom fields and showing message to user](/forum/32-content-creation/891212-validating-custom-fields-and-showing-message-to-user#274391 "-- HikaShop version -- : 3.1.1. -- Joomla version -- : 3.7 -- PHP version -- : 7 -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : none  Hi, have made several custom fields and have seen it is possible to validate with for example &#91;0-9&#93; and this is working well. However, I have measurements in these fields and these should not be bigger than 320 (for example). With Calc Builder I can make validations, but I do not know how to show a message to the user (front end). I have seen in the field table that you have 'errormessage' but how do I trigger this, if at all possible from my validation in calc builder, or how do I validate a field directly in Hikashop custom Fields such that a value entered there is lower than a certain figure? Hope you can help! Thanks")*

Thanks!
Your expression does not seem to work, but have found a way looking at these examples:
[ www.regular-expressions.info/numericranges.html](http://www.regular-expressions.info/numericranges.html)
That is working very well!
Thanks again.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NvbnRlbnQtY3JlYXRpb24vODkxMjEyLXZhbGlkYXRpbmctY3VzdG9tLWZpZWxkcy1hbmQtc2hvd2luZy1tZXNzYWdlLXRvLXVzZXI/dG1wbD1tYXJrZG93bg==) 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.075 seconds

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