Custom validation not working

6 years 6 months ago - 6 years 6 months ago #7974 by Bart
In my registration form I use this customer validation code to verify the format of the information provided by the users.

One of the field is now accepting any input while the custom validation should check against this format
/^[A-Z]{6}[0-9]{2}[A-Z]{1}[0-9]{2}[A-Z]{1}[0-9]{3}[A-Z]{1}|[0-9]{11}$/

But another field custom validation is working fine
/^[+]{1}[3]{1}[9]{1}-[3]{1}[0-9]{2}-[0-9]{6,7}|[+]{1}[4]{1}[1]{1}-[7]{1}[6-9]{1}-[0-9]{7}|[+]{1}[4]{1}[2]{1}[1]{1}-[0-9]{3}-[0-9]{7}$/

The only difference I can see between these two fields is the the first one depends on another field.

If I modify the field definition removing the dependency the validation works.

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

6 years 5 months ago #7977 by Saka
Yes, the client-side validation will not work on dependent fields. It should validate server side though.

Emir Sakic
www.sakic.net

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

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch