NetTalk Central

Author Topic: embedding js on Disconnected Web Apps  (Read 3468 times)

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
embedding js on Disconnected Web Apps
« on: May 22, 2017, 08:27:57 PM »
Hi Bruce,

I have an update form and a button on it and would like to set a field's time value when I click the button.

1. If I wanted to update both the form field and the database fields at the same time, what would be the correct script referring to both database and form fields?
2. Does the js have to be defined first on a script.js file and included in the scripts section of the webserver? or can I just enter the script in the OnClick(javascript) entry as  follows:

'database.myTable.table.record.myField = clock();'

3. Do I need to update ts by "ts = Date.now();" for it to be synced?
5. What would be the correct script to update just the form field and not the table field at OnClick?

Thanks,
Vic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: embedding js on Disconnected Web Apps
« Reply #1 on: May 23, 2017, 07:55:53 AM »
Hi Vic,

complicated questions. Can we discuss this at this week's user group webinar?

cheers
Bruce


de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: embedding js on Disconnected Web Apps
« Reply #2 on: May 23, 2017, 01:42:32 PM »
Ok, Bruce, Thanks!

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: embedding js on Disconnected Web Apps
« Reply #3 on: May 27, 2017, 07:55:04 PM »
Hi Bruce,

Thanks for the walk-through on the proper and recommended way to embed javascripts in disconnected web apps during the User Group Webinar of May 25,2017. I believe it will be NT UG Webinar No.151 for the benefit of other interested parties.

As requested, this will remind you of your intention to add a save function without closing the update form feature. The example you used was in scripts/vtip.js of your example folder.

One more thing, you mentioned there's a way to refer to Element IDs that have random characters? Can you please elaborate as I need to enable and disable Buttons as the fields are populated but their IDs are of these with random characters appended.

Thanks Again,
Vic

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: embedding js on Disconnected Web Apps
« Reply #4 on: May 31, 2017, 07:01:19 PM »
On the issue of disabling a button after use (onClick()), I added 'this.onclick="null" before any other embedded javascript and it worked fine.

de la Rosa

  • Full Member
  • ***
  • Posts: 128
    • View Profile
    • Email
Re: embedding js on Disconnected Web Apps
« Reply #5 on: July 03, 2017, 07:32:38 PM »
Hi Bruce,

Where would be good place to start looking for supported device APIs? Such as if I want to fire an Alert or Ring and if such is already supported in current NT Disconnected Web Apps version?

Thanks,
Vic