Nintex Forms - use substring in Javascript


Badge +1

Hello,

I am trying to extract part of the URL from a Hyperlink control.  In the Customer JavaScript - function, I am trying to use substring to extract the URL.  Here is the sample JaveScript:

function showText()  {   
 
var display = NWF$("#"+txtHyperLink);   

display = display.substring(0, 25);

alert(display.val());   
 
}

When I use a button control to execute the   showText function, the alert does not display on the form.  If I remove the display.substring from the function, the alert will display.   Can I not use Substring in the JavaScript function?   If not, is there another way to extract the URL from the Hyperlink control?  Or can I use the fn-substring inline function in JavaScript?


3 replies

Badge +7

Hi,

The problem is in your JavaScript code itself

Use this:

function showText() {

var display = NWF$("#"+txtHyperLink).val();

display = display.substring(0, 25);

alert(display);

}

Badge +1

Hi Philip,


The updated JavaScript in your reply worked.   Thanks for your help!!!


Thanks

Shannon

Badge +7

Shannon Mongold

Great! So please mark the answer as correct.

BR,

Reply