NetTalk Central

Author Topic: onblur  (Read 3749 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
onblur
« 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.
  • Is it possible to write a validation (java-)script here?
  • Is the value of the field passed in variable elem? Or do I have to retrieve the value from the DOM first before I can process the entered value of that field?

Cheers,

Rene


Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: onblur
« Reply #1 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