NetTalk Central

Author Topic: JS to update session variables or page fields?  (Read 216 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 423
    • View Profile
    • Email
JS to update session variables or page fields?
« on: September 10, 2026, 01:57:43 AM »
Hi,

I am dabbling with the new GooglePlaces address lookup,
and have a very nice smooth interface working.

There are 3 script files and the last one is where the values returned from google places needs to be updated into NTWS and ideally update the fields on the page.
The script files handle all the communication and on screen type ahead interface.

Is there a script to push the values to update session variables along with the page fields?
Or another way to handle this?

thanks

Johan


tvcg1.js ? Google Loader
Stores the Google API key and loads the Google Maps/Places JavaScript library.

tvcg2.js ? Address Search
Creates the Google address search box, restricts searches by country, and gets the selected address from Google.

tvcg3.js ? Address Mapping
Breaks the Google address into its parts and puts them into the correct NTWS fields ? street, suburb, city, province, postcode, country, etc.



thanks

Johan


« Last Edit: September 10, 2026, 02:28:13 AM by JohanR »

JohanR

  • Sr. Member
  • ****
  • Posts: 423
    • View Profile
    • Email
Re: JS to update session variables or page fields?
« Reply #1 on: September 10, 2026, 05:11:11 AM »

Hi,

Think I found the problem, had an issue in the JS.
Will complete testing and resolve and report back

thanks

Johan

rjolda

  • Sr. Member
  • ****
  • Posts: 460
    • View Profile
    • Email
Re: JS to update session variables or page fields?
« Reply #2 on: September 12, 2026, 04:43:07 AM »
Hi Johan,
I am a JS newbie. I would love to see how you use JS to move data from returned fields onto the NT page.
I am querying NTSA API and I get back a string with the vehicle information which I parse out.  I assign the returned data to the respective variables:
e.g. p_web.SSV('AutoYear',returnedYear), etc.
then I do a call to the validate:  DO ValidateValue::CAT:VINnumber 
all of the fields get refreshed.
Ron

osquiabro

  • Hero Member
  • *****
  • Posts: 725
    • View Profile
    • Email
Re: JS to update session variables or page fields?
« Reply #3 on: Today at 04:00:12 AM »
you can add a SessionValue in your script and then read in NT via webhandler in SessionValueSetFromBrowser or redirect in your JS to specific procedure in NT for read a result, example for set a value in JS:

SetSessionValue("striperesponse", JSON.stringify(paymentIntent) );

I recommend implementing it as a procedure outside the web handler, but the web handler is the easiest way to test it.