NetTalk Central

Author Topic: JavaScript Hand-code  (Read 5211 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
JavaScript Hand-code
« 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')

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JavaScript Hand-code
« Reply #1 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

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: JavaScript Hand-code
« Reply #2 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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: JavaScript Hand-code
« Reply #3 on: May 14, 2019, 07:23:30 AM »
what exact text do you have in the template setting?