Hi,
On the thankyou action page I'd like to include some conditional logic based on the value of a field.
This shows:
How can I do something like this?
On the thankyou action page I'd like to include some conditional logic based on the value of a field.
<h2>Training</h2>
<?php if ($form->data['trainingrequired'] == 'Yes') {?>
<p>You have requested training.</p>
<?php } else { ?>
<p>You have not requested training.</p>
<?php } ?>
<p>If you wish to proceed with your quote, please contact us.</p>
This shows:
data['trainingrequired'] == 'Yes') {?>
in the form
How can I do something like this?
Hi Petersen,
Yes you can do this but not in the Cfv4 Thank You Message action as it does' support PHP. Use a Custom Code action instead - it works in the same way but allows PHP.
Bob
Yes you can do this but not in the Cfv4 Thank You Message action as it does' support PHP. Use a Custom Code action instead - it works in the same way but allows PHP.
Bob
Thanks Bob,
If you use the Custom Code - can you use the curly braces or do you need to use the form->data array?
If you use the Custom Code - can you use the curly braces or do you need to use the form->data array?
Hi petersen,
You can use Curly Braces in HTML - but not in PHP. If you are inside the <?php . . . ?> tags you have to use $form->data['input_name'] Here's a demo example including both syntaxes:
Bob
You can use Curly Braces in HTML - but not in PHP. If you are inside the <?php . . . ?> tags you have to use $form->data['input_name'] Here's a demo example including both syntaxes:
<p>Hi {first_name},</p>
<?php
if ($form->data['trainingrequired'] == 'Yes') {
echo "<p>You have requested {$form->data['training_type']} training.</p>";
} else {
?>
<p>You have not requested {training_type} training.</p>
<?php
}
?>
<p>If you wish to proceed with your quote, please contact us.</p>
Bob
Hi petersen,
Sorry, missed this one: Also, how do you get the custom action to display something after submit?
IIRC it should just display - needs to be echoed from PHP or HTML otherwise.
Bob
Sorry, missed this one: Also, how do you get the custom action to display something after submit?
IIRC it should just display - needs to be echoed from PHP or HTML otherwise.
Bob
This topic is locked and no more replies can be posted.