cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

I'm trying to copy the user input from a singleline Textbox to a Label and convert it into a hyperlink:

//Converts it through a button

function test(){
var richtext= "";
var link = NWF$(".richtext input").val();
if(link.indexOf('http://')>=0){
var nohttp = link.replace("http://","");
richtext = '<a href=http://'+nohttp+' target="_blank">'+nohttp+'</a>';
NWF$(".calvalue").html(richtext);

}
}

This works fine but after i save it and i want to display it (in the Dispform), it didn't save it at all.

Does anyone know how i can save html code to a label or control?

Labels: (1)
0 Kudos
Reply
9 Replies
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

if you replace control's HTML markup you destroy control's DOM model which nintex relies on.

so you can not expect nintex will save any value then.

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

So there's no option how i can dynamically display a hyperlink?

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution
0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

But how would i change then the variable? 

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

I'm not sure what you mean...

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

In the example you gave me: 

"<a href=\"http://www.mydomain.com/user=" + varAppendToLink + "\"> click here </a>"

How would you dynamically set the "varAppendToLink" variable with JS?

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

no javascript is needed.

varAppendToLink is named control reference. once the referenced control changes formula is recalculated and link updated automatically.

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

Okay that works, but on dispform it shows as plain HTML, how do i change it? 

0 Kudos
Reply
Workflow Hero

Re: Nintex Forms Javascript how to convert input into a Hyperlink

Jump to solution

you have to configure calculated value control to recalculate in VIEW mode

Reply