• 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: Admin multiple if statements

Admin multiple if statements 7 years 9 months ago #37169

  • gilyboy
  • gilyboy's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Using the documentation example from RSFOrms

I am trying to check that if 2 items are selected that it shows a specific value.

In my case if a certain court type and number of courts is selected then it will output a Fee value.

Here is my attempt from the documentation but I cant get it to work.

{if {Court Type:value}=Cricket Court} && {Number of Courts:value}=1}{Cricket Court Fee 100:value}{/if}


Here is the documentation from RSForms

{if {name_of_field:value}}The submitted message is {name_of_field:value}.{/if}
The string found within the {if} syntax will not show if the field has no value.

The {if} clause also accept the following operators:

<= , >=, <>, <, >, !=, =,==,===, <-, ->

Assuming that you have a checkbox and you need to compare its value with a specific string, you will use:

{if {Checkbox:value}<-Item1}This text will be displayed only if the Item1 value is selected{/if}
If you want to display a text if the checkbox has one of your desired values, you will use the following syntax:
{if {Checkbox:value}->Item1,Item2}This text will be displayed if one of the following values is selected: Item1 or Item2{/if}

If you want to see if the user entered a specific value into a field you can use the following syntax:
{if {field_name:value}=Your desired value} this text gets displayed only if the placeholder has the "Your desired value" value {/if}

Notice the blank space between "if" and the field placeholder.

____
The administrator has disabled public write access.

Admin multiple if statements 7 years 3 months ago #37834

Need same instruction how to use this exactly. Did you solve the problem by yourself?
The administrator has disabled public write access.

Admin multiple if statements 7 years 2 months ago #37879

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
You can't do it using two conditions like that. Are you trying to get a total pricefor your customer to pay or show what it would cost depending on user selection and do you want to show this in the form or the email/pdf that is sent?
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.

Admin multiple if statements 7 years 2 months ago #37888

  • gilyboy
  • gilyboy's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Yes the conditions worked after I applied the latest update. It seems that was all that the issue was.. From there it then allowed me to use the correct conditions to select in the emails as per the documentation. Was easy after that
The administrator has disabled public write access.

Admin multiple if statements 7 years 2 months ago #37889

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
I've learnt something now. Have to try it out.
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.

Admin multiple if statements 6 years 7 months ago #38446

  • tyekynan
  • tyekynan's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Going by what was said... I used this if statement in RSform....

Primary View: {if {resort1:value}=Animal Kingdom Villas} && {room1:value}=Deluxe Studio}{viewakv1:value}{/if}

and this is what it outputs in the email.

Primary View: && Deluxe Studio=Deluxe Studio}Savanna View

Please help, I really need to get this to work. I am using the latest release of rsform as well.
The administrator has disabled public write access.

Admin multiple if statements 6 years 7 months ago #38447

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
Could it be that you are using = which assigns a numeric value (x=y) rather than == which compares string values ($x=$y)
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.

Admin multiple if statements 6 years 7 months ago #38449

  • tyekynan
  • tyekynan's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Well, if I use:

Primary View: {if {resort1:value}=Animal Kingdom Villas}{room1:value}{/if}

Then I get this....

Primary View: Deluxe Studio
(which would be correct)

but I need the if statement to place two conditions.... value of resort and value of room type gives me value of view selected as I have different room type fields that vary.... maybe I can just do this?
{if {room1:value}=Deluxe Studios}{viewakv1:value}{/if}

But will that cause the email to show the other "view" fields? because I didn't narrow it down?

They are grouped like so (field names):

Group 1
Resort 1
Resort 2

Group 2
room1
room2
room3
room 4
etc...

Group 3
viewakv1
viewakv1-2
viewakv1-3
viewakv1-4
etc.

In the field itself. Group 3 is based on the selection of Group 2 and Group 2 is based on the selection of Group 1 via conditional fields. I am trying to input the values select in the email so it doesn't show any extra values except for what is selected.
The administrator has disabled public write access.

Admin multiple if statements 3 years 2 months ago #41891

  • jamesk9
  • jamesk9's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
We were dealing with a similar issue, specific admin email content when 2 conditions were met.

The initial advice to use && is not working. We tried every option, and appears that in the original tip, the curly braces don't match up either. Trying to avoid any PHP scripting in the script section we tried a few more things and found that putting the {if} statement within an {if} statement actually gave us the result we needed:
if {checkbox1:value}->a}Checkbox 1 content only {if {checkbox2:value}->a}Content only showing if Checkbox 2 value = A AND if Checkbox 1 = A{/if}{/if}

Quite literally using the statement within the statement. Hopefully this helps for those that are trying to work with multiple statements as well.
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!