Forums

styling the ouput table / email

hcohl 04 Feb, 2017
On submit my form gives out data via email.
Now I want to style these data. I want to delete empty data rows.
F.e.:
<tr><td>Other name(s):</td><td>{othername}</td></tr>
If "othername" is empty, I want to remove the whole <tr></tr>
I changed to:
<div id="cell">Other name(s): <div id="cell-value">{othername}</div></div>

I tried javascript, but it doesn't work:

$("div#cell-value:empty").parent().remove();

This javascript in the <head> of the output-email-code of chronoforms > setup > on submit > Email...???

Is there anybody with a better idea?
Max_admin 04 Feb, 2017
Answer
Hi hcohl,

You will need php code in the email body for this:

<?php if(!empty($form->data['othername'])): ?>
<tr><td>Other name(s):</td><td>{othername}</td></tr>
<?php endif; ?>


Best regards,
Max
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.