Custom validation not working

2 years 1 month ago - 2 years 1 month 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.

2 years 1 month 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.

We also recommend

Twitter

sakicnet: Register into multiple groups with AJAX Register 3.8 https://t.co/oAt6IJJxQA 722 days ago from Twitter Web Client

Stay in touch