TOPIC:

empty fields 3 years 2 months ago #244348

  • Topic Author
  • gerardb
  • Offline
  • Premium Member
  • Premium Member
  • Registered
  • Posts: 162
  • Thanks: 0
We do have a form with fields not necessary to fill in and they remain empty.
The feed back mail is in html for user and admin. But in this case it will generate blank/empty lines with no info at all. Is there a way to skip this in the output so there will be no empty lines in the mail.
See sample output and code with fields labels and data.
Code:
<tr style="text-align: left; font-family: tahoma, arial, helvetica, sans-serif; font-size: 10pt;">
<td>{1_Vorname:value}</td>
<td> </td>
<td>{1_Name:value}</td>
<td> </td>
<td>{1_Geburtsdatum:value}</td>
<td>{1_Passnummer:value}</td>
<td> </td>
</tr>
<tr style="text-align: left; font-family: tahoma, arial, helvetica, sans-serif; font-size: 10pt;">
<td>{2_Vorname:value}</td>
<td> </td>
<td>{2_Name:value}</td>
<td> </td>
<td>{2_Geburtsdatum:value}</td>
<td>{2_Passnummer:value}</td>
<td>{2_Kind_unter_16_Jahre:value}</td>
</tr>
<tr style="text-align: left; font-family: tahoma, arial, helvetica, sans-serif; font-size: 10pt;">
<td>{3_Vorname:value}</td>
<td> </td>
<td>{3_Name:value}</td>
<td> </td>
<td>{3_Geburtsdatum:value}</td>
<td>{3_Passnummer:value}</td>
<td>{3_Kind_unter_16_Jahre:value}</td>
</tr>

Output in mail:
see attachement

How to solve this that there are no empty lines in the mail?
Attachments:

Please Log in or Create an account to join the conversation.

empty fields 3 years 2 months ago #244351

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Registered
  • Posts: 12079
  • Thanks: 788
Hi,

Please go to your form->Advanced->more options->Admin Emails->Report->and select Nonempty values.
Do the same for Mailback Email.
Nonempty values - will send data from all fields which were completed, but will not send data from fields that were left empty.

Let me know if it helps.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

empty fields 3 years 2 months ago #244360

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Administrator
  • Administrator
  • Super Users
  • Posts: 10544
  • Thanks: 866
@gerardb

Are you using the email template in form => advanced => more options => admin/mailback emails?

Regards,
Markus

Please Log in or Create an account to join the conversation.

empty fields 3 years 2 months ago #244392

  • Topic Author
  • gerardb
  • Offline
  • Premium Member
  • Premium Member
  • Registered
  • Posts: 162
  • Thanks: 0
Yes I use the option don't send empty fields.
This is not the problem as it works fine.
The problem is how to get rid of the empty white lines reserved in the output.
see the screen print I send with the question.
So the fields are empty if there is no data, but the space is still reserved as it is with the html code.

Please Log in or Create an account to join the conversation.

empty fields 3 years 2 months ago #244393

  • Topic Author
  • gerardb
  • Offline
  • Premium Member
  • Premium Member
  • Registered
  • Posts: 162
  • Thanks: 0
yes see the answer, I use this.

Please Log in or Create an account to join the conversation.

empty fields 3 years 2 months ago #244396

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Administrator
  • Administrator
  • Super Users
  • Posts: 10544
  • Thanks: 866
Hi,

the simple templates ususally don't support conditions but I just created a patch for you, so you can hide empty elements.

Please download and install the component attached (just install over your existing BF installation).

Then in form => advanced => more options => settings => set "Log to database" to "All values" (otherwise it won't work).

In your email template, wrap everything that is supposed to be hidden for empty values using the new {hide} tag. Example
<p>{hide FIELDNAME}{FIELDNAME:label}: {FIELDNAME:value}{/hide}</p>

Replace FIELDNAME with the name (not title) of the fields you want this to apply to.

It is also recommended to use "Toggle Editor" for this and work with the raw HTML as the editor might add unwanted HTML tags that would prevent these tags from being recognized.

File Attachment:

File Name: com_breezi...7-08.zip
File Size:3,948 KB


Regards,
Markus
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Subscribe to news and updates!

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!