• 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: Delete empty line when left empty

Delete empty line when left empty 4 years 10 months ago #39137

  • info44548
  • info44548's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 1
In one of my new forms, the visitor has the possibility to fill out 2 options, week 1 and/or week 2.
I have placed these two options underneath eachother.

When somebody fills out week 1 and week 2, the outcome is shown like this:

You wish to choose
Week 1
Week 2
Thank you


When somebody fills out week 1 and leaves week 2 empty, the outcome is shown like this:

You wish to choose
Week 1
empty space
Thank you


When somebody fills out week 2 and leaves week 1 empty, the outcome is shown like this:

You wish to choose
empty space
Week 2
Thank you


Is there a way to leave the empty space out, so everything fits better like this:

You wish to choose
Week 2
Thank you


Thanks in advance!
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39139

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 213
  • Thank you received: 57
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39142

  • info44548
  • info44548's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 1
Thank you for your reply.
Unfortunately, I am not an expert with this.

Is there simple way to explain this to me?
Like

{if {week_1:value}=empty}display:none{/if}

Or doesn't it work like that?
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39143

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 213
  • Thank you received: 57
Works like this, here's an example form one of my own forms:

{if {Address 2:value}}{Address 2:value}{/if}<!--If field has no value do not show-->

notice the space between the first if and the bracket { this is important.
I m not sure i quite understand how your form choices are layed out but if are you using a dropdown for your choices you could write this:

{if {your field name:value}}{your field name:value}<br>Thank you.{/if}

If you are laying the form out differently and the options are separate fields it will require some more statements but is easy enough to do, let me know
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39145

  • info44548
  • info44548's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 1
I have 2 options underneath (not the same element, seperate options) with Week 1 and Week 2
The visitor can eather choose Week 1, Week 2 or both.

What I am looking for: if Week 1 is chosen and Week 2 is not, Week 2 should appear as an empty line in the message and e-mail.
And vice versa for Week 2 (chosen) and Week 1 (chosen).

Short: if the option is not chosen, it should not be shown as an emtpy line in the message and e-mail.


Is there an option for this?

Thanks in advance!
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39146

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 213
  • Thank you received: 57
If the options are separate and have field names week_1 and week_2 you could use

You wish to choose
{if {week_1:value}}{week_1:value}<br>{/if}
{if {week_2:value}}{week_2:value}<br>{/if}
Thank you

So what this is saying is if week_1 or week_2 have no value (not selected) do not show it.
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39152

  • info44548
  • info44548's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 1
I have tried your option, but without any result.
I have put it in the e-mail and then a <br> appears behing the line.
Also the empty line is still there.

Did I put the code in the falls location??
The administrator has disabled public write access.

Delete empty line when left empty 4 years 10 months ago #39153

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 213
  • Thank you received: 57
It' probably me not quite understanding something. I realised as well I shouldn't have put the <br> tag in as you're working with email. I use the PDF more where it can be used. In emails the editor is almost certainly automatically putting <p>....</p> tags outside the {if} statement which means you will always have the blank paragraph if no value is chosen
Try this, create a simple form and set up a checkbox field called 'chosen' containing Week 1, Week 2 and Weeks 1 & 2. In attributes set to allow only one choice and in validation set to required. If they are not required to chose one of the weeks you could add 'Not at this time' or something like that and make it the default by putting [c] after it.

Then in the email add this

some text....................

{if {chosen:value}}
You chose:
{chosen:value}
Thank you.....
{/if}

more text.............

That works so you should be able to adapt to your needs.
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
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!