NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on May 05, 2019, 12:57:23 PM

Title: JavaScript Hand-code
Post by: rupertvz on May 05, 2019, 12:57:23 PM
Hi Guys,

I've been trying to put some hand-code Javascript into a NWF, Field (Client Side, When Field Accepted in Browser)
I am unable to get the Javascript code to execute,

Not sure if I am using the wrong format in NT?

For example:  I would like to call a function from the hand-code JavaScript section
let myCipher = cipher('String')
Title: Re: JavaScript Hand-code
Post by: Bruce on May 05, 2019, 10:52:31 PM
Hi Rupert,

It's impossible to comment on what you are doing wrong without seeing an example of what you are doing.

cheers
Bruce
Title: Re: JavaScript Hand-code
Post by: rupertvz on May 13, 2019, 01:32:41 PM
Hi Bruce,

As an example, under the "JavaScript : OnChange" routine-embed of a NWF field,
I tried to add some JavaScript ...

Say I would like to set a sessionvalue:

if (window.innerWidth <= 1300) {
     SetSessionValue('SmallScreen','True')
     }

The script is working from the HTML tab of the NWF, but not when I try to include it in the field routine embeds?
Title: Re: JavaScript Hand-code
Post by: Bruce on May 14, 2019, 07:23:30 AM
what exact text do you have in the template setting?