Hello,
I have to set a form with a compatibility with IE7 so I'm obliged to have a server validation instead of JS validation. My question is how I can test a validation for field (french zipcode) if I want this field to be 5 digits (no more no less).
With JS I set a custom a Load Javascript on Load with this code :
With a server validatin how can I do it ?
Thx for answers
I have to set a form with a compatibility with IE7 so I'm obliged to have a server validation instead of JS validation. My question is how I can test a validation for field (french zipcode) if I want this field to be 5 digits (no more no less).
With JS I set a custom a Load Javascript on Load with this code :
function cpostalCheck(el){
if ( !el.val().match(/^([0-9]{5,5})$/) ) {
return false;
} else {
return true;
}
With a server validatin how can I do it ?
Thx for answers
Hello erix,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Handling serverside validation errors . . .
How can I add Auto Serverside Validation?
How do I use Custom Serverside validation?
How can I run Auto and Custom Serverside Validation together?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
Handling serverside validation errors . . .
How can I add Auto Serverside Validation?
How do I use Custom Serverside validation?
How can I run Auto and Custom Serverside Validation together?
P.S: I'm just an automated service😉
Thx calculus00 to submit theses links but I have already read them and I didn't find the answer in tit😟
Hi erix,
The code has to be translated into PHP from JavaScript. It will be something like this:
Bob
The code has to be translated into PHP from JavaScript. It will be something like this:
<?php
if ( isset($form->data['cpostal']) && preg_match('/^([0-9]{5,5})$/', $form->data['cpostal']) === false ) {
return false;
} else {
return true;
}
?>
Bob
Thx Bob,
Ok I understand I have to put this code in a custom code but my question now is to know where I have to put this custom code : in server validation/On success ? Before Server validation ?
Ok I understand I have to put this code in a custom code but my question now is to know where I have to put this custom code : in server validation/On success ? Before Server validation ?
In v5 you can use Bob's code in an "Event switcher", and return the event name instead of true/false.
Here is how to use the event switcher:
https://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html
Regards,
Max
Here is how to use the event switcher:
https://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html
Regards,
Max
This topic is locked and no more replies can be posted.