Apologies in advance for what is probably a really basic question however I can't find the answer anywhere...
is there an easy way to exit from an event without executing all the formcalc code?
If you have a look at the end of this example, you will see how you can check how the user has exited the field. Wrap the condition you want in an if statement.
Hope that helps,
Thanks for that, interesting! However unfortunately that wasn't quite what I was looking for, let me try to explain a bit more...
What I have is some code in an exit event and in some circumstances I do not want that to be executed so ideally what I'd like to do is at the start of the event:
if check = failed
exit ;i.e. don't execute any of the other code below
Obviously I could wrap all the code around the IF condition but I was wondering if I could do something more like the above?
I answered thinking I was in a different thread.
I would approach it from:
if (check eq passed) then
// your script block
So that the script inside the if statement will only fire if the condition is met.
Does that make sense?
Thanks Niall - that does make sense. I was just wondering however whether there was any way I could exit up-front rather than have to nest all my script block between the IF ENDIF statements? In other languages you can do EXIT or RETURN for example to exit a method or subroutine.
"return" is reserved for use within a function. You cannot use it outside of a function.
"break" is used within a loop or switch statement.
Not sure about "exit", but I suspect not.
Europe, Middle East and Africa