Hi!
I want that, in case there is an empty field in the form, not to send it in the email. How can I do it?
I know that an empty field will not be sent if it is empty, but its container will be sent. For example:
If I only write in in field_1, only appear this field in the email, but also appear the empty space for the structure field_2
I tried to compare with PHP, but it doesn't work. The email has error. I tried this:
And this:
But it doesn't work
Thanks!
I want that, in case there is an empty field in the form, not to send it in the email. How can I do it?
I know that an empty field will not be sent if it is empty, but its container will be sent. For example:
<table>
<tr>
<tr>{field_1}</tr>
</tr>
<tr>
<tr>{field_2}</tr>
</tr>
</table>
If I only write in in field_1, only appear this field in the email, but also appear the empty space for the structure field_2
I tried to compare with PHP, but it doesn't work. The email has error. I tried this:
<table>
<?php
if !({field_1}) {
<tr>
<tr>{field_1}</tr>
</tr>
}
?>
</table>
And this:
<table>
<?php
$field_1 = {field_1};
if !($field_1) {
<tr>
<tr>{field_1}</tr>
</tr>
}
?>
</table>
But it doesn't work
Thanks!
Hi entumas,
Your PHP needs fixing :-( Please try
Bob
Your PHP needs fixing :-( Please try
<table>
<?php
if ( !empty($form->data['field_1']) ) {
echo "
<tr>
<tr>{$form->data['field_1']}</tr>
</tr>";
}
?>
</table>
Bob
This topic is locked and no more replies can be posted.