Skip to main content

Field validation

2 years 11 months ago #357379 by StudioPrzyLesie
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.

2 years 11 months ago #357381 by nicolas
Replied by nicolas on topic Field validation
Hi,

I think the problem is with your regular expression.
You need to add anchors to it:
javascript.info/regexp-anchors
So try instead:
Code:
^([0-9]{10})$

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

2 years 11 months ago #357403 by StudioPrzyLesie
Replied by StudioPrzyLesie on topic Field validation
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.039 seconds
Powered by Kunena Forum