Hi,
Would it be possible to do something like the following: have an editable text field in which the user may enter some text (eg the answer to a question in a quiz). On pressing return the user's answer is checked against the stored answer (this is a really simple quiz so the two should match if the user has got it correct), and notify the user of success/failure and then update their score accordingly.
I would like to do this from the field rather than have the user enter an answer in a field then click a button to check their answer. However as I understand it a field needs to have its lock property set to false in order to be editable. But it needs to be locked in order to receive messages which get it to do something.
I've looked at returnKey, and returnInField but the penny is not dropping, so any help would be much appreciated.
Thanks in advance.
Editable field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Editable field
Hi garyth123,
just add this script to an editable field and see what happens when you hit RETURN or ENTER:
Best
Klaus
just add this script to an editable field and see what happens when you hit RETURN or ENTER:
Code: Select all
on returninfield
answer "End of editing :-)"
## Or do whatever you want to now!
end returninfield
## Also "catch" the ENTER key:
on enterinfield
returninfield
## Too lazy to write the RETUNINFIELD handler again :-)
end enterinfield
Klaus