Field validation

  • Posts: 193
  • Thank you received: 15
  • Hikashop Business
11 months 1 week ago #357379

Hi,
For example, I have a simple validation of the VAT number field, where it should check whether 10 digits have been entered. If I enter less than 10 - a message pops up, but if I add 11 - it saves without problems :( Can it be configured differently?
Example:
Regular expression check: ([0-9]{10})

Tom

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 1 week ago #357381

Hi,

I think the problem is with your regular expression.
You need to add anchors to it:
javascript.info/regexp-anchors
So try instead:

^([0-9]{10})$

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

  • Posts: 193
  • Thank you received: 15
  • Hikashop Business
11 months 1 week ago #357403

Nicolas,
Great - that was it - thank you
Tom

The following user(s) said Thank You: Philip

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

Time to create page: 0.056 seconds
Powered by Kunena Forum