Forums

Thanks Message

Ravens 05 Sep, 2011
In CFv4, can you use PHP commands in the Thanks Message event? Or is there some way to show different text depending on a radio button that was selected on the form?

Thanks
Tami
GreyHead 05 Sep, 2011
Hi Tami,

It doesn't look as though you can use PHP in the Thanks message.

You can use a Custom Code action to set the value for a block of text in the $form->data array and then display that in the Thanks message.
<?php
if ($form->data['like_fruit'] ) {
  $form->data['recommend'] = "Our bananas are great today.";
} else {
  $form->data['recommend'] = "How about a kilo of broccoli.";
}
?>
Then use {recommend} in the Thank You message.

Bob
This topic is locked and no more replies can be posted.