NetTalk Central

Author Topic: Best place for additional Netweb Form Validation?  (Read 6158 times)

Neil Porter

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
Best place for additional Netweb Form Validation?
« on: March 24, 2016, 01:52:10 AM »
I'm using a Netweb Form to gather input from a user. Once I've completed my own validation (checked fields have been populated etc.) I need to post the results to an external 3rd Party Webservice, which will further validate the data returning a success for fail.

I've been using the "ValidateAll" embed to add my call the the extra web service because I don't want the contents of my form being saved unless I pass the 3rd party validation.

On the face of it everything works fine, and has been in production for some time, BUT we get occasional queries about duplicates being posting to the 3rd Party Webservice. We've never been able to reproduce this, and it seems very random.

By chance yesterday we stumbled upon the issue. Our Netweb form remains visible whilst the call to the 3rd Party web service is completed. If this call is slow (maybe a second or 2 to complete) it is possible that a user can press the save button on our form multiple times believing that the page has hung, causing multiple duplicate posts to the 3rd party.

Can anyone suggest a better way of achieving what I want, or an alternative embed, or even a way of stopping the user pressing the save button on the form multiple times?

Regards,

Neil Porter
Clarion 11.0.13244
NetTalk 11.04

Vinnie

  • Full Member
  • ***
  • Posts: 182
    • View Profile
    • Email
Re: Best place for additional Netweb Form Validation?
« Reply #1 on: March 24, 2016, 05:13:34 AM »
Hi Neil.

Maybe an option to have an Other button on you form which would be the 'Validate Button'

The user would need to press the 'Validate' button which would run the 3rd party validate.

You can Disable / Enable the 'Validate' button in you validate routine.

Cheers

Vinnie

 

Aje.elias

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Best place for additional Netweb Form Validation?
« Reply #2 on: March 24, 2016, 05:23:30 AM »
Hi,
I suggest that you try creating a new thread for that code. Example:

Start(Source_Procedure,25000, parameters)

Where in Source_Procedure, must be the call extra webservice..


Best Regards!

Alejandro Elias

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Best place for additional Netweb Form Validation?
« Reply #3 on: March 29, 2016, 11:34:13 PM »
an upcoming build should disable the "save" button when it is pressed the first time.

cheers
Bruce

Neil Porter

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
Re: Best place for additional Netweb Form Validation?
« Reply #4 on: March 30, 2016, 08:38:52 AM »
Thanks Bruce.

I have got my code in the "Right" place then?

Regards,

Neil.
Clarion 11.0.13244
NetTalk 11.04

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Best place for additional Netweb Form Validation?
« Reply #5 on: March 30, 2016, 11:52:32 PM »
yes, I think so.