Custom client side validation not showing up..?

Implement custom client-side validation in ChronoForms.

Overview

The issue occurs when using outdated CFv4 syntax in a CFv5 form, preventing the custom validation function from being called.
Update the validation rule in the input field to use the CFv5 syntax, or add the function name in the Custom function box within the validation tab.

Answered
ti timzuidgeest 16 Dec, 2014
Hey guys,

So I went to this article >
http://www.chronoengine.com/faqs/54-cfv4/cfv4-validation/2656-how-can-i-add-a-custom-client-side-validation.html
Did everything as asked.
But the validation doesn't seem to be working..
The javascript it's loading (first in the onload)
function customCheck(el){
  if ( !el.val().match(/^\+316\d{8}$/) ) {
    return false;
  } else {
    return true;
  }
}

(the regex formula is for a dutch mobile number).

It doesn't trow me an error when I'm filling something else than that number in.. Which of course it should. Am I doing something wrong?
This is the page! Hope you can help me
https://www.independent-duinrand.nl/index.php?option=com_chronoforms5&chronoform=Machtigingsformulier
ti timzuidgeest 16 Dec, 2014
Hi Automated service, thanks but no thanks😉.

I've already checked that article out, and it didn't help me further.

Hope someone can help me!
Max_admin Max_admin 16 Dec, 2014
Hi Tim,

Which Chronoforms version do you have ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Gr GreyHead 16 Dec, 2014
Answer
Hi timzuidgeest,

It looks as if the function isn't being called. You have this class in the input validate['required','%customCheck'] which is the old CFv4 code. In CFv5 it looks as if it is validate['required', 'custom:customCheck']

Or, better, you can scroll down the validation tab and add the function name to the Custom function box at the bottom.

Bob
ti timzuidgeest 16 Dec, 2014
Thank you Bob for you quick reply!

The validate['required', 'custom:customCheck'] works as a charm!! Thanks!

Maybe it's handy to change that on that page that I looked? (Don't know if you can do that)
Gr GreyHead 16 Dec, 2014
Hi timzuidgeest,

I updated the FAQ when I replied to you - at least I think I did . . .

Bob
This topic is locked and no more replies can be posted.