Hello,
I'm finding I'm using pretty much the same validation code in a number of forms and when I have to tweak it, I have to go into each form to do this.
I was thinking of using a require statement in the php code to include a php file that would have the validation code in it. Where would be the best place to put this file so it won't be over-written with new updates?
Thanks.
I'm finding I'm using pretty much the same validation code in a number of forms and when I have to tweak it, I have to go into each form to do this.
I was thinking of using a require statement in the php code to include a php file that would have the validation code in it. Where would be the best place to put this file so it won't be over-written with new updates?
Thanks.
Hi Chris,
Please see this FAQ. This was a CFv4 FAQ but I still do the same in CFv5 except that the code to get the form name is a little different so my macro now gives
Bob
Please see this FAQ. This was a CFv4 FAQ but I still do the same in CFv5 except that the code to get the form name is a little different so my macro now gives
<?php
include (JPATH_SITE.'/components/com_chronoforms5/includes/'.$form->form['Form']['title'].'/file_name.php');
?>
Bob
Thank you Bob.
The form is reading the script. When an improper character is entered in a field I am getting my error message from the script. However, it is not returning to the event switcher. on fail it should reload the page. on success it should save the data.
Here is what I have in my event switcher.
Am I missing something?
Thanks,
Chris
The form is reading the script. When an improper character is entered in a field I am getting my error message from the script. However, it is not returning to the event switcher. on fail it should reload the page. on success it should save the data.
Here is what I have in my event switcher.
<h3><p style="text-align: center; background-color: #F2F274;">
<?php
require (JPATH_SITE.'/components/com_chronoforms5/includes/'.$form->form['Form']['transfer_equip_form'].'/validation.php');
?>
</p></h3>
Am I missing something?
Thanks,
Chris
Hello again,
Never mind. I think I solved the problem. 😶 I used a custom code above the event switcher to call the validation script. I then had the event switcher evaluate the result I sent back from the script. 😀
Regards,
Chris.
Never mind. I think I solved the problem. 😶 I used a custom code above the event switcher to call the validation script. I then had the event switcher evaluate the result I sent back from the script. 😀
Regards,
Chris.
This topic is locked and no more replies can be posted.