NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Robert Iliuta on July 28, 2010, 12:06:13 AM

Title: ValidateUpdate embed and Alert message
Post by: Robert Iliuta on July 28, 2010, 12:06:13 AM
Hallo,


I have in a form in ValidateUpdate embed , some code to check if a value is true or false. After this code I have another code which is executed only if the above is true. When I press the save button and the value of my variable is false then a message popup and return to form. All is ok. After some tests I found out that after the validate popup message it run the code which is after the alert message. Bellow is my code.

  IF MEM:X = 0
     loc:invalid = 'MEM:X'
     p_web.SetValue('retryfield','UpdateMembri')
     loc:Alert = 'Please confirm !'
  END

! Here is the code  which run only if the MEM:X = 1
.....


It is ok if the validation faild,  to run the code which is after the validation?


Thank you for any advise.

Regards,
Robert
Title: Re: ValidateUpdate embed and Alert message
Post by: Alberto on July 28, 2010, 03:32:39 AM
Robert,
You can have many validations and they are arrange in a cascede of validations, the user see the last validation in the cascade.
If you need yo check one validation first, then you need to place it last.
Hope this helps
Alberto
Title: Re: ValidateUpdate embed and Alert message
Post by: Bruce on July 28, 2010, 10:48:09 AM
yes, the idea is that if you have say 4 invalid fields on the form then all 4 display as invalid at the same time.
much better than showing the user 1, then they click save, then show them another one, and so on.

Of course immediate validation is much better.

cheers
Bruce
Title: Re: ValidateUpdate embed and Alert message
Post by: Robert Iliuta on July 28, 2010, 09:32:33 PM
Ok, understand now. Also  there is any code to stop validation and return ?

Thank you all.
Robert
Title: Re: ValidateUpdate embed and Alert message
Post by: Bruce on July 30, 2010, 11:39:52 PM
sure, just
EXIT
the routine
Title: Re: ValidateUpdate embed and Alert message
Post by: Robert Iliuta on July 31, 2010, 09:28:22 PM
Thank you Bruce,
It works perfect.
Robert