Skip to main content

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?

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.


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


there are some tricky workarounds, see eg. following

https://community.nintex.com/message/56726-re-add-variable-to-url-on-nintex-form?commentID=56726#comment-56581 


But how would i change then the variable? 


I'm not sure what you mean...


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?


no javascript is needed.

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


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

214354_pastedImage_1.png


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


Reply