I have a text element in which I want to have a link.
As far as I know, there are two ways to do this:
First, use plain text, select the text and add a link to it.
Second, write the text in HTML, with a <a href="" onclick=""></a>
element.
The first option is very limited; for instance it is not possible to trigger a workflow or change a variable value from the link editor.
How do I either trigger a workflow or change a variable value when my HTML element is clicked?
I’ve tried to use a custom JS function, without success (the console returns that the “myFunction” function is undefined):
function myFunction() {
alert('hello world!');
}
<a onclick='myFunction();'>Click me</a>
I’ve also tried to use wwLib.wwVariable.updateValue()
, also without success:
return "<a onclick='"+wwLib.wwVariable.updateValue(varID, varValue)+"'>Change variable value</a>"