Forums

Update ChronoForms 5 code to ChronoForms 6

ltempest 11 Apr, 2019
Hello,
I currently have a v5 form that uses some custom php code in the email template:
<?php if ( !empty($form->data['SSS-HPLB']) ) { echo "{$form->data['SSS-HPLB']} - HPLB"; } ?>

This adds part of the the input value ID to the value that was entered in the input box.

I'm in the process of updating and rebuilding this form into ChronoFroms v6, however this code does not seem to translate to the v6 form.

Can anyone help and provide an example of how this should be formatted for a v6 form?

Thanks

Lee
Max_admin 11 Apr, 2019
$form->data is $this->data

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ltempest 12 Apr, 2019
Thanks for the reply, I've now changed my code to:
<tr>
<td>Roofing Product Line Brochure</td>
<td><?php if ( !empty($this->data['SSS-HPLB']) ) { echo "{$this->data['SSS-HPLB']} - HPLB"; } ?></td>
<td><?php if ( !empty($this->data['MSS-HPLB']) ) { echo "{$this->data['MSS-HPLB']} - HPLB"; } ?></td>
<td> </td>
</tr>
<tr style="background-color: #D9D9D9">
<td>Polyiso Facer Guide</td>
<td><?php if ( !empty($this->data['SSS-FACER']) ) { echo "{$this->data['SSS-FACER']} - FACER"; } ?></td>
<td><?php if ( !empty($this->data['MSS-FACER']) ) { echo "{$this->data['MSS-FACER']} - FACER"; } ?></td>
<td> </td>
</tr>

But when I submit the form, the email does not format and provide the entered value, instead I get:

Which seems to just render the code?
Max_admin 12 Apr, 2019
Yes, the email body will NOT run PHP code, you shoukd place this code in a "Custom code" action before the email, set the "Return as var" to enabled, then use {var"custom_code_name} in the email body!

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ltempest 15 Apr, 2019
Hi,
Thanks for the explanation, I'm still not 100% certain what to do?

Would it be possible for you to provide an example of the code I need to add into the custom code action?

Thanks for the help and advice.

Lee
Max_admin 15 Apr, 2019
Put the code you have in a "Custom code" action, make it ABOVE the email, enable the "return as var", then use {var:custom_code_name} in the email body!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.