This question has been answered by Bruno17. See the first response.
Hi all,
I'm new to MODX - and I think you're gonna see me around here quite often.
We're currently working on a form which is doing several things at the same time. Among other things the user can subscribe to a newsletter. We are using FormIt (2.0.3) and all is well. Except, we are trying to have a conditional hook, as such:
&hooks=`recaptcha,spam,email[[+rdoSubscribe:neq=`No`:then=`,mChimpXSubscribe`:else=``]],redirect`
We can't get the output filter to work (tried with If Package as well - no luck).
In the email itself,is output as Yes or No as expected. The radio buttons in the template look as such:[[+rdoSubscribe]]
<input type="radio" name="rdoSubscribe" id="rdoSubscribeYes" value="Yes" [[!+fi.rdoSubscribe:FormItIsChecked=`Yes`]] />Yes <input type="radio" name="rdoSubscribe" id="rdoSubscribeNo" value="No" checked="checked" [[!+fi.rdoSubscribe:FormItIsChecked=`No`]] />No
Any idea how to have a conditional hook based on a radiobutton. That would be really helpful.
Thank in advance.
adrian
<?php return (isset($_REQUEST['rdoSubscribe']) && $_REQUEST['rdoSubscribe'] == 'Yes') ? ',mChimpXSubscribe' : '';
&hooks=`recaptcha,spam,email[[!addSubscribeHook]],redirect`