41
Web Server - Ask For Help / How to execute code once on Form Load?
« Last post by JohanR on September 24, 2026, 02:43:47 AM »Hi,
What is the preferred method or embed to ensure code only runs once on form generation, popup or page loaded.
I am currently using
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
Using code below, it runs through twice, even if checking on p_web.SetValue('SignInResetPassword_form:inited_',1)
Attached code and debuglog for initform and preupdate code/logs
thanks for any advice
Johan
InitForm Routine
DATA
LF &FILE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
! End of "Initalize the Form before anything else is done"
CODE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
ds_OutputDebugString('>>> InitForm <<<' & format(clock(),@t06))
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
ds_OutputDebugString('========== 2nd time' & format(clock(),@t06))
else
ds_OutputDebugString('========== 1st time' & format(clock(),@t06))
end
! End of "Initalize the Form before anything else is done"
p_web.SetValue('SignInResetPassword_form:inited_',1)
p_web.formsettings.file = ''
p_web.formsettings.key = ''
do RestoreMem
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
What is the preferred method or embed to ensure code only runs once on form generation, popup or page loaded.
I am currently using
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
Using code below, it runs through twice, even if checking on p_web.SetValue('SignInResetPassword_form:inited_',1)
Attached code and debuglog for initform and preupdate code/logs
thanks for any advice
Johan
InitForm Routine
DATA
LF &FILE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
! End of "Initalize the Form before anything else is done"
CODE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
ds_OutputDebugString('>>> InitForm <<<' & format(clock(),@t06))
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
ds_OutputDebugString('========== 2nd time' & format(clock(),@t06))
else
ds_OutputDebugString('========== 1st time' & format(clock(),@t06))
end
! End of "Initalize the Form before anything else is done"
p_web.SetValue('SignInResetPassword_form:inited_',1)
p_web.formsettings.file = ''
p_web.formsettings.key = ''
do RestoreMem
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
42
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« Last post by AtoB on September 24, 2026, 01:11:16 AM »Been working on this (quite a bit of work actually), but for anyone interested, I think this is a really good resource : https://webhooker.eu/blog.
Also there are services that (like this webhooker) take care of the pesky details
Also there are services that (like this webhooker) take care of the pesky details
43
Web Server - Ask For Help / Re: Custom response headers
« Last post by the_question on September 23, 2026, 01:45:10 AM »This is inside NetWebHandleRequest:
Code: [Select]
p_web.CreateHeader PROCEDURE(NetWebServerHeaderDetailsType p_HeaderDetails)
ReturnValue ANY
! Start of "NetTalk Method Data Section"
! [Priority 5000]
! End of "NetTalk Method Data Section"
CODE
! Start of "NetTalk Method Executable Code Section"
! [Priority 2500]
p_HeaderDetails.CustomHeader = CLIP(p_HeaderDetails.CustomHeader) & |
'<13,10>Cross-Origin-Opener-Policy: same-origin' & |
'<13,10>Cross-Origin-Embedder-Policy: require-corp'
! Parent Call
ReturnValue = PARENT.CreateHeader(p_HeaderDetails)
! [Priority 7500]
! End of "NetTalk Method Executable Code Section"
RETURN ReturnValue
44
Web Server - Ask For Help / Re: Custom response headers
« Last post by Bruce on September 21, 2026, 01:16:02 PM »show your code, and where it goes.
45
Web Server - Ask For Help / Re: Small and fast response
« Last post by Bruce on September 21, 2026, 01:12:49 PM »I think you'll find the current error fits inside the minimum TCP packet size. You won't see any performance difference making it smaller.
But of course you can derive your own code into the SendError (or wherever) to send back whatever you like.
But of course you can derive your own code into the SendError (or wherever) to send back whatever you like.
46
Web Server - Ask For Help / Re: Show/hide password in login form
« Last post by rjolda on September 19, 2026, 07:10:34 AM »Jane,
That is pretty nifty. Good example of JS use. Very helpful for those of us who are slowly getting our toes wet with JS.
Thanks for sharing.
Ron
That is pretty nifty. Good example of JS use. Very helpful for those of us who are slowly getting our toes wet with JS.
Thanks for sharing.
Ron
47
Web Server - Ask For Help / Re: Show/hide password in login form
« Last post by Jane on September 18, 2026, 11:02:18 AM »At a guess, you've forgotten to add the class to the button.
It sets the button to transparent with no border and no outline.
It sets the button to transparent with no border and no outline.
48
Web Server - Ask For Help / Re: Show/hide password in login form
« Last post by Richard I on September 17, 2026, 06:07:17 PM »Hi Jane,
I have it working, thank you, in my app.
But I do have one issue please.
My TogglePasswordButton, while having the eye icons ok, is coloured solid blue and is the same size and border defined as the other fields,
whereas your button in your app, is hidden with only the icon showing.
I have added to my app, your custom.css
Ill check the CSS files and add Color Transparent, but
If you could comment, on the size ,that would be appreciated.
Regards,
Richard
I have it working, thank you, in my app.
But I do have one issue please.
My TogglePasswordButton, while having the eye icons ok, is coloured solid blue and is the same size and border defined as the other fields,
whereas your button in your app, is hidden with only the icon showing.
I have added to my app, your custom.css
Ill check the CSS files and add Color Transparent, but
If you could comment, on the size ,that would be appreciated.
Regards,
Richard
49
Web Server - Ask For Help / Custom response headers
« Last post by the_question on September 17, 2026, 07:27:04 AM »Hello,
I am trying to add some elements in response headers for NetWebPage. I have found in NetWebHandleRequest p_web.CreateHeader procedure. There is a parameter NetWebServerHeaderDetailsType p_HeaderDetails. When I add data in p_HeaderDetails.CustomHeader before ReturnValue = PARENT.CreateHeader(p_HeaderDetails) call, nothing is saved in generated header.
How can I add elements in response header?
I am trying to add some elements in response headers for NetWebPage. I have found in NetWebHandleRequest p_web.CreateHeader procedure. There is a parameter NetWebServerHeaderDetailsType p_HeaderDetails. When I add data in p_HeaderDetails.CustomHeader before ReturnValue = PARENT.CreateHeader(p_HeaderDetails) call, nothing is saved in generated header.
How can I add elements in response header?
50
Web Server - Ask For Help / Re: Media how to display PDF in a BLOB in a Media Object
« Last post by JohanR on September 16, 2026, 10:40:04 PM »Hi Ron
Think you need to save the PDF to disk and then specify the name of the file in the media control.
regards
Johan
Think you need to save the PDF to disk and then specify the name of the file in the media control.
regards
Johan
Recent Posts