Stop field editing when Cancel button pressed

nfeasey at utpress.utoronto.ca nfeasey at utpress.utoronto.ca
Thu Mar 4 07:56:18 EST 2004


I have a simple database that contains, amongst other things, a person's
name.
When the user enters a new record the "fName" field cannot be blank.
 
Therefore, I obviously have some code like...
 
on closefield
 
-- Check that the field is not empty, if it is then display an error dialog,
blah, blah...
 
end closefield
 
 
However, should the user change their mind and not want to add a record,
they can press a "Cancel" button.
I had the "Cancel" button set a global flag that indicates that the current
transaction has been cancelled.
 
The problem is that if the "fName" field has focus, is blank, and they click
the "Cancel" button, the on closefield function will be
executed prior to the "Cancel" button doing it's bit.
 
I guess what I'm trying to ask is there a proper way that experienced Rev
programmers handling the editing of fields?
Do you do all of your editing when the user clicks, say, the "Save" button
and not perform editing tasks on individual fields?
 
Is there a way to bypass edit checks on fields should the user "Cancel" an
operation?
 
It's probably a simple matter but, as usual, it's just not clicking in how
to handle the situation.
 
Any advice, as always, is appreciated.
 
N


More information about the use-livecode mailing list