NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: JohanR on September 10, 2026, 01:57:43 AM

Title: JS to update session variables or page fields?
Post by: JohanR 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


Title: Re: JS to update session variables or page fields?
Post by: JohanR 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
Title: Re: JS to update session variables or page fields?
Post by: rjolda 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
Title: Re: JS to update session variables or page fields?
Post by: osquiabro on September 13, 2026, 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.