In a stack, I've set up a menu button which asks the user to enter their name and email address before showing an email button.
So, I am using an ask box, putting "it" into a variable. An ask box seems to have 3 options: (1) the user enters something, (2) they enter nothing and click OK, or (3) they cancel.
What I would like to set up: if the user enters nothing or cancels, the email button remains invisible, does not show.
So, I use "if it is not empty, then show the email button...end if"
And, 'if it is empty then answer "Please enter..." end if'
Should work, but doesn't.
I have also tried if <variable that it is put into> is empty then "Please enter..." end if, etc.
When clicking OK with nothing entered or clicking cancel, the email button still shows.
Any way to prevent the email button from showing if the requested information is not entered (just blank) or the ask box is canceled?
Here's the code I'm using now that doesn't succeed:
Code: Select all
ask "Please enter your name and email address"
put it into xName
answer xName
if it is not empty then
show button "Send email"
end if
if it is empty then
answer "Please enter your name and email address" titled "Please Provide Information"
end if
Kind Regards,