Field macro condition in Form Autoresponder

Tommy De Notarpietro asked on June 27, 2016 13:48

Can I use a macro to show or hide a section ( like a paragraph or a set of paragraphs ) in the body on a field condition?

It's possible to show the values, but I tried to write a condition to show/hide source and it didn't work.

Here's code I inserted in the editor's html source:

<html>
<head>
    <title></title>
</head>
<body>
<p>{% Delivery %}</p><!-- Shows the delivery field value. Can be email or post. -->

<!-- Doesn't work to check on this field to show or hide paragraphs -->
{% if (Delivery = "email") { %}
<p>You requested by <strong>email</strong></p>
{% } %} 

{% if (Delivery = "post") { %}
<p>You requested by <strong>post</strong></p>
{% } %}
</body>
</html>

Correct Answer

Felix Planjer answered on June 27, 2016 14:23

You need to use double equal sign:

{% if (Delivery == "email") { %}
0 votesVote for this answer Unmark Correct answer

Recent Answers


Zoltán Jalsovszky answered on June 27, 2016 14:28

Hi Tommy,

The main problem with the code is in the if conditions - you should use "==" instead of "=". However you don't even need to use if conditions, the following code should do the same:

<p>You requested by <strong>{% Delivery %}</strong></p>
0 votesVote for this answer Mark as a Correct answer

Tommy De Notarpietro answered on June 27, 2016 14:46

It's true that you don't need if - conditions, but it was a simple representation of my problem. I needed to show different e-mail text based on condition. So my main problem was that I was using "=" instead of "==".

Thanks.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.