I am currently recreating some my forms in CF v6 from v5. Having two issue:
1. In file input's settings, CFv5 used to have a field to attach a custom Javascript function that was triggered when a file was selected. How can I do the same in v6?
2. In v5 I could use php in email template. v6 seems doesn't process php tags
Thanks in advance
Hi riponinuter,
Was this the custom validation function in CFV5? I think that the equivalent must be the validation rules box - though I'm not clear how you use that.
Bob
Thanks for your prompt reply.
Yes, it was in CFv5 - if you click on edit on a file input in Designer, you will see it in Validation tab (check the attachment). Not sure how to do it in validation rules box in v6. Any help would be great.
" In v5 I could use php in email template. v6 seems doesn't process php tags"
Is this by design or any other way to do that in v6?
Hi riponinuter,
In v6 a custom validation function can be placed in the "Validation rules" box:
validateFile:This file is not valid
And in a "Custom" javascript element use this code:
$.fn.form.settings.rules.validateFile = function(value, parameter) {
return false;
};
Regarding php, you can not call php in email body in v6, you need to use a PHP action before the email, set any value you want inside a variable:
$this->set("var_name", 333);
Then get it in email:
{var:var_name}
try to have unique var names, like "myvar" or whatever.
What are you trying to do with PHP in the email ?
Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Hi Max,
Thanks for all the helpful info. I think having a documentation for CFv6 would save lot of your support time.
"What are you trying to do with PHP in the email ?"
Instead of of creating many forms, for the sake of simplicity and easy maintenance, I have created a generic form that I use in many similar pages in my website. The contents of email's body depends on the page the user submit the form from. I use PHP to determine the page URL and other info, and generate contents accordingly.
Hi riponinuter,
I will try to have some documentation added soon, thank you!
I think the best way to do it then is using the PHP function as I explained.
Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Yes, I will use PHP before email and save dynamic email body in a variable. However, as in V5, if PHP could be processed in email body template that would have been easy and more dynamic, unless you have that in TODO list.
Thanks for all the help
Hi riponinuter,
There is no way to process php in email body in v6, but I forgot something, you could use a "Custom code" action, it supports php, then you can enable the "return result as var", and you could just use this shortcode in the email body:
{var:custom_code_name}
The custom code output would then be placed in the email body.
Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
Hi Max,
Great help! will try and let you know if any issues.