NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DonnEdwards

Pages: 1 2 [3] 4
31
Web Server - Ask For Help / Re: JavaScript on an Update Form
« on: May 01, 2021, 05:58:52 AM »
Found it!
var strFirst = document.getElementById("vis__first_name").getAttribute("Value");
should read
var strFirst = document.getElementById("vis__first_name").value;

and so on. The only consolation of being a newbie is that I am learning ...

32
Web Server - Ask For Help / JavaScript on an Update Form
« on: April 29, 2021, 05:23:29 AM »
I have a Visit record that contains the following fields:

patient_name
sortkey

first_name
last_name

The first two fields are read-only. I want patient_name to be the first_name followed by a space and then the last_name. I want the sortkey to be the first 3 letters of the last_name in upper case, followed by the first 3 letters of the first_name, in lower case.

I want these first two fields to be updated as soon as the user changes first_name or last_name.

I wrote a JavaScript function that calculates the field values, and I used the addEventListener() method to set up an onchange event to call my function on first_name and last_name. It works correctly on a simple HTML page, but not on my NetTalk 12 Updatevisit NetWeb form wen it is running.

<!-- Script to update Sortkey and Patient name -->
<script>
// Add onclick event to vis__sortkey and vis__patient_name
document.getElementById("vis__sortkey").addEventListener("click", fnOnChange);
document.getElementById("vis__patient_name").addEventListener("click", fnOnChange);

// Get the first 3 characters of First name and first 3 character of last name for the sort key
// Written by Donn Edwards (c) 2021 Black and White Inc
function fnOnChange() {
  var strFirst = document.getElementById("vis__first_name").getAttribute("Value");
  strFirst = strFirst.trim();
  var strLast = document.getElementById("vis__last_name").getAttribute("Value");
  strLast = strLast.trim();
  var strSort = strLast.toUpperCase() // Start the sort key with 3 upper case letters from Last Name
  strSort = strSort.substr(0, 3);
  var strName = strFirst              // Name consists of First Name and last Name
  strFirst = strFirst.substr(0, 3);
  strSort += strFirst.toLowerCase()   // Append 3 lower case letters from the First Name
  strName += ' '
  strName += strLast
  strName = strName.trim();
  document.getElementById("vis__patient_name").setAttribute("Value", strName); // Set the new patient name
  document.getElementById("vis__sortkey").setAttribute("Value", strSort);      // Set the new sort key
}
</script>


My problem is that only the onclick event on the read-only fields will fire off the function.

Is there another way to do this, with or without JavaScript? I don't want to wait until the user clicks the "Save" button before calculating these values.

Update: I finally noticed the "Client Side" tab of the field properties in the form. I have specified 'fnOnChange' for both the 'onFocus' and 'onChange' values, but neither seem to have any effect, either as 'fnOnChange()' or 'fnOnChange'. Only the onclick works.

I'm using NT 12.17

Any help will be appreciated.

33
Web Server - Ask For Help / Re: Thread Pool vs Thread Number
« on: April 28, 2021, 04:04:49 AM »
Thanks Vinnie and Bruce.
I guess RTFM is in order  8)

34
Web Server - Ask For Help / Thread Pool vs Thread Number
« on: April 28, 2021, 01:06:07 AM »
I am puzzled by some of the diagnostic information on my NT Webserver app.

On the "Performance" page it shows a thread pool of zero. On the "Log" page it shows thread numbers of 0, 3 and 4.

Are these different concepts?

The reason I ask is that I'm getting a "Memory block free'd twice" random error on my internet-facing server app and I'm wondering if there is some default I need to fix.

35
Web Server - Ask For Help / Firewall Rules for NetTalk Server
« on: April 28, 2021, 12:56:50 AM »
I have tried to make my Windows server as secure as possible for running my NT Webserver app.

See attached Inbound and Outbound rules. How many of the Outbound rules can I disable? I am using Remote Utilities instead of RDP and a nice LONG password for the Administrator user. It is not part of any Active Directory.

The NetTalk Server rule opens TCP ports 80 and 443.

Any other advice on how to keep my Windows Server on the internet as secure as possible will be greatly appreciated. Also, are there any other considerations when hosting the server on AWS?

36
Web Server - Ask For Help / Re: Exception occurred at address 0103B904
« on: April 26, 2021, 01:20:32 AM »
Thanks Bruce

The backend is TPS at this stage. I will move the data tables to PostgreSQL once I am satisfied that the data structure is not going to change much.

FWIW here is my latest error, using NT 12.13. I haven't posted a new version with the debug code in it yet. That's today's project  ;)


37
Web Server - Ask For Help / Re: Exception occurred at address 0103B904
« on: April 25, 2021, 11:31:14 AM »
Many thanks Don, I'll try it out.

Is it safe to deploy a debug version to a live server? I'll assume the answer is yes.

38
Web Server - Ask For Help / Re: NetTalk 12.15
« on: April 25, 2021, 10:50:15 AM »
Getting same errors in Firefox and Chrome (see attached). I tried updating certificates and that didn't help either.

39
Web Server - Ask For Help / Exception occurred at address 0103B904
« on: April 25, 2021, 09:14:58 AM »
I'm getting this random error after my webserver has been running for a few hours, and only on the live server, not on my development machine.

Exception occurred at address 0103B904
Exception code C0000005: Access Violation
Process PID=1276  Image: C:\dev\test6\kgoffice6.exe
Thread 27  Handle=00000534  TID=1480


The full gory details are in the attached log file. How would I go about trying to trace down the cause? So far there are only about a dozen lines of hand code in the entire app, and they occur when the app starts.

Any hints or suggestions on where to begin will be most welcome.

40
Web Server - Ask For Help / Re: capturing Phone number on log in
« on: April 22, 2021, 11:49:53 PM »
Pogressive Web Apps is part of NT Apps. I'm not sure whether it will work for NT Server, but you can check what options are available when you create the app.

If you are using NT Server and Secwin 7 the site will remember if you have logged in or not, and you can set the time limit. It's really convenient. I'm not sure if the standard login does the same.

If the user has registered from the phone, isn't there a (first party) cookie on the phone for the website? Perhaps you could store the user ID of some kind in the cookie?

It used to be that all mobile browsers sent the mobile phone number (MSISDN) to the web server in the headers. I'm glad it doesn't happen any more, because it was badly abused. see blog article from 2011

You need to add a timer or something to the panic button so the user can cancel the panic if they clicked on it by mistake. I have a "trackbox" app on my phone that gives me 10 seconds to cancel the emergency when I open the app. After that it notifies the server.

Hope this helps!
Donn

41
Web Server - Ask For Help / Re: WebServer Generate errors
« on: April 22, 2021, 11:32:47 PM »
Thanks for the clarification. As long as I'm not breaking anything ...  8)

42
Web Server - Ask For Help / Re: WebServer Generate errors
« on: April 21, 2021, 10:19:14 PM »
Hi Ron and Bruce

Yes, when I am running the wizard to create a new application, but I get it in a new folder that only has a dictionary file and absolutely no clw files unless they were just created by the wizard. I used the term "Generator" because that's what the title of the message says.

Why would the wizard ask me a question if it "knows" that it just created these files and needs to overwrite them? Bear in mind I have a very limited understanding of how the Wizard works, but it seems to me like an error.

I will continue to answer Yes  :)

Best wishes
Donn

43
Web Server - Ask For Help / WebServer Generate errors
« on: April 21, 2021, 09:58:45 AM »
I'm getting these two errors (see attachments below). File names vary, but it's always number 1 and 4 because my "Procedures per module" application option is set to 1.

Am I right in assuming it's OK to click Yes in both cases? I'd rather ask than screw up my project. I'm using NT 12

44
Web Server - Ask For Help / Re: NetTalkServer extra buttons
« on: April 20, 2021, 05:03:19 AM »
Perhaps I didn't explain the use case too clearly. The exe runs on my development PC and then I copy it to the live server. Each box has different settings, but the same EXE.

See images side by side below. So when I click on the "Insecure Address" on my dev box, it opens http://192.10.200.98:88 because that's what the settings are. I click the same button on the live server and I get http://kgoffice.co.za:80 which is then immediately redirected to https://kgoffice.co.za as expected.

Or I can save time and click on the "Secure Address" button on the live server and get https://kgoffice.co.za:443 straight away.

The buttons allow me to check that I got the settings correct. For example I forgot to change port 88 to port 80 on the live server, so the "Insecure Address" button showed me something was wrong.

45
I have a field in each table in my NT Server app called "UpBy". It's a string field of 200 characters. I want to be able to put some text in it that indicates who inserted or updated it, assuming they made a change and didn't just view it. Something like

DonnEdwards 2021-04-17 23h08 Add 155.93.152.18

Firstly,  where do I initialise a session variable "UserName" to read "Not Logged In"? Once the user logs in I will change it to the actual user name.

Secondly, where do I put the code to generate the string, assuming I want this string to be the session variable "UserName" followed by the date and time, followed by the word "Add" or "Change", followed by the user's IP address?

Thirdly, how do I detect whether the record is being inserted or updated? Also, how do I avoid changing the field if the record hasn't been modified?

All suggestions, ideas and tips will be most welcome. I'm still busy with RTFM, so please forgive me if this is discussed in the documentation. Just point me to an example or section of the notes.

Pages: 1 2 [3] 4