I would like to use a eform event. Something I have done in the past, but sometimes it just doesn’t work, and I can’t seem to tie down why.
Calling
[!fileUpload!][!eForm? &formid=`ContactForm` &replyto=`email` &subject=`[*pagetitle*]` &to=`[email protected]` &ccsender=`0` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &vericode=`1` &requiredClass=`requiredValue` &cssStyle=`formStyles` &eFormOnBeforeMailSent=`checkMime` !]
where fileUpload looks like:
function checkMime (&$fields){
return true;
}
should work?
Taff
Adrian Lawley: www.adrianlawley.com
try setting the first snippet to [[fileUpload]] (cached)
Thanks, as always for your help dev!
Unfortunately that helped none, but I think I have it now.
The problem would appear to be that once a function wasn’t found, no matter what you change the name of the function to, or the snippet name, eForm will not find it unless....
You call the eForm snippet like this:
[[SnippetContainingMyFunction]]
[!eForm?¶meters=`lots but no event call`!]
so removing the event parameter, calling the page, then replacing it seems to work.
Thanks for your help!
Taff
Adrian Lawley: www.adrianlawley.com
So I came across the exactly the same problem on a different site today. I pulled and pulled at my hair, got really upset, and then:
I noticed that I get that error if the snippet being called throws a parse error.
Maybe this was the problem all along?!?
Cheers,
taff
Adrian Lawley: www.adrianlawley.com
I had the same problem, and found that if i called the eFormEvent snippet uncached it solved the problem
eg [!eFormEvent!]
i think also it was because there was a parse error in the snippet, and i couldnt get round the fact the snippet had been read with the error and lodged in the cache. Once i fixed the snippet, it still didnt work - but once i called the eFormEvent uncached I was back in business.