• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How to hide empty fields in email?

How to hide empty fields in email? 14 years 4 months ago #12149

  • hominid4
  • hominid4's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
Within the email results from a form I know to hide empty fields that weren't filled out in the form it's necessary to insert a script under the "Email Scripts" tab so that it checks the form submission before sending the email but I've been unable to find a hint on how to do that. Is there by chance an example for that in the documentation?

Thanks!
The administrator has disabled public write access.

Re:How to hide empty fields in email? 14 years 4 months ago #12157

  • hominid4
  • hominid4's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
Hi, I was was needing this form active by Monday, anyone have an idea how to hide fields in an email that weren't filled out in the form?

Thanks!
The administrator has disabled public write access.

Re:How to hide empty fields in email? 14 years 4 months ago #12167

  • hominid4
  • hominid4's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
Is this not a common script? I would think many others have done this.

Any help would be greatly appreciate, thanks.
The administrator has disabled public write access.

Re:How to hide empty fields in email? 14 years 4 months ago #12207

  • hominid4
  • hominid4's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 22
I'm not sure how to approach a script where it does an overall check but if the form fields were broken down shouldn't something like this work?
if ( $_POST['form']['Name'] ){
  echo  "{Name:caption}{Name:value}<br />";
}
if ( $_POST['form']['Email'] ){
  echo  "{Email:caption}{Email:value}<br />";
}
if ( $_POST['form']['Phone'] ){
  echo  "{Phone:caption}{Phone:value}<br />";
}
if ( $_POST['form']['Message'] ){
  echo  "{Message:caption}{Message:value}";
}
The administrator has disabled public write access.

Re:How to hide empty fields in email? 13 years 10 months ago #13898

  • billy3
  • billy3's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
I'd like to know how to to this as well
Seems like a simple request but no answers from anyone?
Can anyone help please.

It looks very unprofessional when customer gets the email and it has every feild listed in the email whether they selected the option or not.

Please?
The administrator has disabled public write access.

Re:How to hide empty fields in email? 13 years 10 months ago #13911

  • xingu
  • xingu's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 32
  • Thank you received: 1
Anyone?
The administrator has disabled public write access.

Re:How to hide empty fields in email? 13 years 10 months ago #13921

I would be interested in this as well!
The administrator has disabled public write access.

Re: How to hide empty fields in email? 13 years 6 months ago #15129

  • j37h3r
  • j37h3r's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 1
This seems like a no brainer, how come there's no support on this?
The administrator has disabled public write access.

Re: How to hide empty fields in email? 13 years 1 month ago #16597

  • info535
  • info535's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Could anyone from the support team please sprinkle this thread with wisdom from his mighty brain...
How do we get access to the form variables so we can hide empty values in the email text?

Thx!
The administrator has disabled public write access.

Re: How to hide empty fields in email? 13 years 1 month ago #16612

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re: How to hide empty fields in email? 13 years 1 month ago #16622

  • info535
  • info535's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
For german users:

There is a mistake in the language file. The backend tells you to include the <?php> tags!

THIS IS WRONG!

The support told me to remove the php-tags, then it worked! Hopefully the RS-Team will fix this mistake soon. This wrong translation stole a lot of my time. :S
The administrator has disabled public write access.

Re: How to hide empty fields in email? 13 years 1 month ago #16753

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
Hi!

I have tried to do according case 2 in the documentation http://www.rsjoomla.com/support/documentation/view-article/610-php-email-scripts.html
but no empty placeholders are hided in the sent email.

Can any guide me how to do. I placed the code in the field "Script called before the Admin Email is sent."

Joomla 1.5.25 and 2.5.2
RSForm 1.4 rev 43

Thanks!

Matt
The administrator has disabled public write access.

Re: How to hide empty fields in email? 12 years 7 months ago #19134

  • adion
  • adion's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
I'm also interested in getting this to work. I have tried to follow this guide: www.rsjoomla.com/support/documentation/v...p-email-scripts.html, without result.
The administrator has disabled public write access.

How to hide empty fields in email? 10 years 1 month ago #30559

  • stevent
  • stevent's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
This works only if a field has no value, but doesn't work if a field a field is hidden conditionally AND has a value. Take this scenario:
  • There's a field with two answer options: yes / no
  • If choice = yes show field 2
  • if choice = no show field 3

Suppose a user first selects yes and answers question 2, but then changes his mind and answers no and then question 3.
In this scenario field 2 is hidden, but still has it's value and is being submitted as such. So your e-mail would look like:
  • Question 1: No
  • Question 2: answer to question 2
  • Question 3: answer to question 3

What you want is:
  • Question 1: No
  • Question 3: answer to question 3

So, in addition you should write a script that checks the answer to question 1 and empties the values of either question 2 or 3. But this is painstaking if you have a form with a lot of conditional fields and option.

So it would be beter if RSJoomla would add a feature that is a field is hidden through a condition, the values are not submitted.
Last Edit: 10 years 1 month ago by stevent.
The administrator has disabled public write access.

How to hide empty fields in email? 10 years 1 month ago #30579

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
Have you tried using the pseudo-code with the if statements?
Example:

{if {field_name:value}}this text gets displayed only if the placeholder has a value{/if}

More information can be found here:
https://www.rsjoomla.com/support/documentation/view-article/74-how-to-configure-emails.html/url]
My help is not official customer support. To receive your support, submit a ticket by clicking here
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!