Custom end message based on condition

More
3 weeks 4 days ago #191181 by blocka
I have a survey where the last question is:

Do you want to enter our contest?

If they reply Yes, I'd like on the End Message to display the link to enter the contest. I thought I could do this

{if(Q37=='A2', '<img src=/upload/surveys/341578/images/ipad.png style=float: left; height: 233px; width: 180px; /><br/><a href=http://example.com target=_blank><p><span style=font-size:18px;>Click here to be taken to another site where you can provide us with your contact information. </span></p>
<p>This keeps your previous questionnaire responses anonymous.</p>', 'Thank you for completing the survey<br/>You can now close your web browser.')}

But instead, I get this output:



What am I doing wrong?
Attachments:

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 weeks 4 days ago #191184 by holch
I think you can't use HTML code within an equation, that is the problem.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 weeks 4 days ago - 3 weeks 4 days ago #191185 by blocka
Figured it out: use double quotes around the HTML, single quotes around elements, and DO NOT leave any spaces between tags -- any spaces between tags causes the parsing error.

So, my condition works when it is coded like this:
{if(Q37=="A2", "<center><p><img style='height: 233px; width: 180px;' src='/upload/surveys/341578/images/ipad.png' alt='' /></p><h2><a href='https://example.com'>Click here to be taken to another site where you can<br/> provide us with your contact information.</a></h2><p>This keeps your previous questionnaire responses anonymous.</p></center>", "Thank you for completing the Survey<br/>You can now close your web browser.")}
Last edit: 3 weeks 4 days ago by blocka.
The following user(s) said Thank You: DenisChenu

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!