Not allow special characters in text Custom Field

  • Posts: 25
  • Thank you received: 1
9 years 1 month ago #216584

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.5.26

Hi

I have created a text custom field but when a client enter special characters like: !@#$%^&*() e.t.c. it creates problem in a custom report module I have.
Can we not allow to enter them, or make the field to delete them on save?

Thank you

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 1 month ago #216601

Hi,

Sure, no problem.
Edit your custom field via the menu System>Custom fields. There, you can use a regex in the field "Regular expression check".
For example, in your case, this should do the job:

/[a-z0-9 ]+/i
www.regular-expressions.info/tutorial.html

The following user(s) said Thank You: nojunkgoodfood, marcovanlennep

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

Time to create page: 0.058 seconds
Powered by Kunena Forum