Field validation

  • Posts: 187
  • Thank you received: 15
  • Hikashop Business
4 months 2 weeks 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: 81540
  • Thank you received: 13071
  • MODERATOR
4 months 2 weeks 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: 187
  • Thank you received: 15
  • Hikashop Business
4 months 2 weeks 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.061 seconds
Powered by Kunena Forum