[ChronoForms 6] How to insert code in Event Switcher?

danielitob 06 Feb, 2020
Hello,
i have a php with name "checkspam" that return 2 value, "spam" and "nospam".
include (JPATH_SITE.'/components/com_chronoforms6/extras/php-spam-filter-master/spamfilter.php');
$blacklists = array(
'blacklist-misc.txt',
'blacklist-medication.txt',
);
$filter = new SpamFilter($blacklists);
$result = $filter->check_text($this->data['messaggio']);
if ( $result ) {
return 'spam';
} else
{
return 'nospam';
}
Then I have a Event Switcher, with 2 different events (spam and nospam). I attach a screenshot for better clarification. If i enter in event "nospam", the message "message37" doesn't appear.[ChronoForms 6] How to insert code in Event Switcher? image 1


This is my debugger:
Array
(
    [option] => com_chronoforms6
    [cont] => manager
    [chronoform] => form-test-spam
    [event] => submit
    [messaggio] => test
    [button45] => 
)
Array
(
    [checkspam] => Array
        (
            [returned] => nospam
            [var] => nospam
        )

)

Could you help me? Thanks in advance,
regards

Daniele
healyhatman 06 Feb, 2020
Need to see your event switcher settings itself not just the branches
danielitob 07 Feb, 2020
Hi, thanks for reply.
I attach the event switcher settings, that invoke 2 different events[ChronoForms 6] How to insert code in Event Switcher? image 2

Thanks very much, i hope you can help me!
danielitob 07 Feb, 2020
thanks, it works!
best regards
This topic is locked and no more replies can be posted.