NetTalk Central

Author Topic: How to Update HEADER on PAGE when Information changes  (Read 2396 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
How to Update HEADER on PAGE when Information changes
« on: December 30, 2023, 04:50:35 AM »
Hi All,
Using NT 14.13 and C 11.0.136.
I have some variables in the XHTML of the Page Header:
<!-- Net:s:Dealer-->
  ------>>  Location:
<!-- Net:s:LoginName-->
  ------>>  Location:
<!-- Net:s:tLocName-->
  ------>> Vehicle:
<!-- Net:s:Vehiclee-->
 ------>> Auto Owner:
<!-- Net:s:Owner-->

What I want to do is CHANGE some of the values of the Header variables such as s:Vehicle - when a different vehicle is chosen.

How do I get the HEADER to refresh with the new information?
TIA,
Ron

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: How to Update HEADER on PAGE when Information changes
« Reply #1 on: January 02, 2024, 04:35:06 PM »
Hi All,
Bruce replied in 3rd party Newsgroup.  Bruce, thanks - that was all I needed to know to get started.  In essence, put the text in the header in a div tag and give it a name so that it can be addressed.  then use Javscript call to function to change the text.  Now, I know what to do.  Now, I have to get under the hood and dive into Javascript and start writing some functions!
Thanks Bruce, that got me started.
Ron

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to Update HEADER on PAGE when Information changes
« Reply #2 on: January 03, 2024, 10:17:21 PM »
Hi Ron,

Probably I'd suggest something like...
a) wrap the session value in the header in a div;

<div id="sOwner"><!-- Net:s:Owner--></div>

(Because the Net:s: no longer appears in the header once it's served, just the data, so if you want to update the data you'll need a way to identify it.)

b) In the form, on the Server side code; something like (not tested)
p_web.script('$("#sOwner").html("' & somenewvalue & '")')

Cheers
Bruce

PS - Posting the same question in multiple places may seem helpful to you, but is unhelful to everyone else.
However if you do that, and the response was helpful, please post the whole response, not your interpretation of the response.