Im carrying out validation in the `$buttonOK_Click` block and if theres an error, it should prompt (this it does). Once clicking 'OK' on the error you should be able to modify input before submitting again.
However Im not entirely sure how to exit the block to stop the form closinging and to stop the main() continueing. Ive tried using a break, returns and even tried the same breakout attempt in the main() form but with no luck.
Any help would be apprecaited.
https://ibb.co/hWRBXz
***Code Block***
https://ibb.co/nQJfQK
Abort GUI 'OK' click due to validation of form input
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Abort GUI 'OK' click due to validation of form input
Thanks for the prompt response however, I dont see a closing event function etc?
Re: Abort GUI 'OK' click due to validation of form input
Just look at the events list under the form. It is called "FormClosing" and is in the "Behavior" group.
See: https://info.sapien.com/index.php/guis/ ... rm-control
See: https://info.sapien.com/index.php/guis/ ... rm-control
Re: Abort GUI 'OK' click due to validation of form input
I dont see that event on the form event list. Maybe because I dont have a cancel button?
https://ibb.co/gPifue
https://ibb.co/gPifue
Re: Abort GUI 'OK' click due to validation of form input
You won't see it until you add it.
Look up how to add events in the manual. There are a number of ways to do this. THe easiest is to right click on the form and select Add Events".
Look up how to add events in the manual. There are a number of ways to do this. THe easiest is to right click on the form and select Add Events".
Re: Abort GUI 'OK' click due to validation of form input
Arrr I see! Thank you, out of curiousity is there something to identify if the X to close the window is pressed? As im doing validation checks in the closing event I get validation failures if I close the form on the X too. So the form doenst close on the X press
Re: Abort GUI 'OK' click due to validation of form input
Do you have a recommended way to handle the validation with regards to the location it runs? On OKclick event etc?
Re: Abort GUI 'OK' click due to validation of form input
Validation only runs in validation events. You seem to be missing how events work.
There are a great may articles that describe various approaches to validation. We have to design a validation mechanism that applies to the task we are performing and the event structure of forms.
There are a great may articles that describe various approaches to validation. We have to design a validation mechanism that applies to the task we are performing and the event structure of forms.