• 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: RSForm! Pro PDF Plugin {if} statement an "else"

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40817

  • info4683
  • info4683's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
Hello.

I have this code in my PDF layout:
{if {fieldname:value}} Display Text ABC{/if}

This works fine and if the form field has a value, the text is displayed in the genereted PDF. If it has no value, no text is displayed.

But now i want to display "Text XYZ" if the field is empty and has no value.
I think it must be an "else" statement somehow but I didn´t figure it out. I believe it is very easy but unfortunately my skills im programming are pretty bad.

Can anyone help me out?

Regards
Martin
Kaum macht man etwas richtig, schon klappt´s..
Last Edit: 4 years 4 months ago by info4683.
The administrator has disabled public write access.

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40818

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
Are you using a field with selectable options or just a field that is empty unless something is entered?
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 4 years 4 months ago by iceferret.
The administrator has disabled public write access.

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40819

  • info4683
  • info4683's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
Hi.

It is a simple checkbox.

I solved displaying a text when it is checked.

Now i want to display "Text XYZ" if the box is not checked.

Regards
Martin
Kaum macht man etwas richtig, schon klappt´s..
The administrator has disabled public write access.

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40820

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
Okay so when you create a checkbox field it usually has some values under items, you might have a single checkbox like yes . I usually use the if this way in cases like that with != (does not equal)
{if {checkboxName:value}=Yes}You selected Yes{/if}
{if {checkboxName:value}!=Yes}You did not tick the box{/if}

If you had two checkboxes i.e yes and no you could also do it like this althought e first instance works for either
{if {checkboxName:value}=Yes}You selected Yes{/if}
{if {checkboxName:value}=No}You selected No{/if}
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 4 years 4 months ago by iceferret.
The administrator has disabled public write access.

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40821

  • info4683
  • info4683's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
iceferret wrote:
Okay so when you create a checkbox field it usually has some values under items, you might have a single checkbox like yes . I usually use the if this way in cases like that with != (does not equal)
{if {checkboxName:value}=Yes}You selected Yes{/if}
{if {checkboxName:value}!=Yes}You did not tick the box{/if}

Ok, I use the first variant.
Unfortunately this doesn´t work in my case.
It displays always "You did not tick the box" - even if the box was ticked.

But thank you very much for this hint, I didn´t know about the "!= (does not equal)" statement.
I´ll play around with this the next days.

Regards
Martin
Kaum macht man etwas richtig, schon klappt´s..
The administrator has disabled public write access.

RSForm! Pro PDF Plugin {if} statement an "else" 4 years 4 months ago #40822

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
It may be because I forgot a } in the code, should have been two of them after the =yes
{if {checkboxName:value}=Yes}}You selected Yes{/if}
{if {checkboxName:value}!=Yes}}You did not tick the box{/if}
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.
The following user(s) said Thank You: info4683
  • 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!