NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on January 08, 2020, 11:10:43 PM

Title: onblur
Post by: Rene Simons on January 08, 2020, 11:10:43 PM
Hi all,

I am trying to  create a PWA. Therefore some validation on the client side must be done in javascript.
Looking into the source of one of my netwebform procedures I noticed some JQUERY-javascript embed points.
See attachment.

Cheers,

Rene


Title: Re: onblur
Post by: Bruce on January 08, 2020, 11:49:23 PM
First off, unfortunately, that embed point is not "active". It's there as a proof-of-concept, but the template language needs a feature added so I can retrieve the embed contents. So far SV have resisted making this update to the template language.

Fortunately there is a template setting you can use.
For the field, Client-Side tab, [onChange] section, "JavaScript Hand Code".
You can put any JavaScript you like in here, but I recommend making this a simple function call - like
'ValidateSomeField(this)'

Passing "this" as a parameter is similar to "self" in clarion - the function will have the "entry field element" in "this" - which means you can then check the value, manipulate the value, and so on.

Cheers
Bruce