Page 1 of 1

ask dialogue - empty vs. cancel

Posted: Wed Apr 13, 2011 9:23 pm
by witeowl
With the ask dialogue, is there a way to differentiate between an empty response and the user hitting cancel?

Here's the scenario: I have an email field populated with data (if it exists). If the user clicks on the field, "ask" will come up, pre-populated with the email from the field (for easier editing). If the user hits cancel, I want nothing to change, but if the user deletes the email and hits OK with an empty field, I want the field to be cleared.

The problem is that "it" appears to never be "cancel" with an ask dialogue, so the user hitting cancel and the user clearing the field both trigger "if it is empty".

Suggestions?

Re: ask dialogue - empty vs. cancel

Posted: Wed Apr 13, 2011 9:31 pm
by Klaus
Hi whiteowl,

you can check "the result" which will be "cancel" if the user had hit "cancel"
and use IT, no matter if IT is empty or not.

Code: Select all

...
ask....
if the result = "cancel" then
 exit to top
end if
## Now you can do whatever you want with IT
...
Hope that helps!


Best

Klaus

Re: ask dialogue - empty vs. cancel

Posted: Wed Apr 13, 2011 9:34 pm
by witeowl
That does, thanks!