PennController for IBEX › Forums › Support › Concatenating Strings › Reply To: Concatenating Strings
May 26, 2021 at 9:37 am
#6998

Keymaster
Hi Doug,
PennController elements, and Text elements in particular, are not strings, so you cannot just concatenate them to a string with +
. More info here: https://doc.pcibex.net/how-to-guides/using-javascript/
Here’s how to achieve what you need:
newVar("link")
.set(getVar("pID"))
.set(v=>"<p><a href='https://pitt.co1.qualtrics.com/jfe/form/SV_9suLiT1t7sABeDg?id="+v+"' target='_blank' rel='noopener noreferrer'>Click here to complete a brief survey on Qualtrics.</a></p>")
,
newText("")
.text(getVar("link"))
.center()
.print()
Jeremy