Forums

PHP in "Display Message" not rendered

htavares 11 Sep, 2015
When using the "Display Message", I mixed some php with HTML within the php tags
<?php mycode; ?>
but the result in the form is commenting the php code. Renders this:
<!--?php mycode; ?-->


Why is this and how can I make it work?

Note that the caption of the "Display Message" says "Message code, HTML code with PHP code support, you may use the curly brackets formula, PHP code should be inside tags."
GreyHead 11 Sep, 2015
Hi htavares,

It appears to be a bug in the notes :-( I suspect that using PHP caused problems with the Rich Text Editor and it was disabled.

If you put the same code in a Custom Code action in the same place it should display correctly.

Bob
htavares 11 Sep, 2015
I already had discovered that using the "Custom Code" action was an alternative, but do you have a plan to fix the "Display Message" action?
GreyHead 11 Sep, 2015
Hi htavares,

Sorry, I don't know what is on Max's To Do list :-(

Bob
htavares 11 Sep, 2015
Ok, no problem, the "Display Message" had two advantages: Use the ritch text editor and give a name to the action, but I can live with the custom code🙂
GreyHead 11 Sep, 2015
1 Likes
Hi htavares,

You can mix and match if you like. Use the Custom Code action to create the value you want in the $form->data[''] array e.g.
<?php
$form->data['my_custom_text'] = $form->data['a'].' some text here '.$form->data['b'];
?>
then put {my_custom_text} in the Display Message action afterwards.

Bob
htavares 11 Sep, 2015
Great suggestion!
I didn't know that technique, thank you!
This topic is locked and no more replies can be posted.