Simplest method for determining "changes made" on a form/card

J. Landman Gay jacque at hyperactivesw.com
Tue Jan 3 17:12:41 EST 2012


On 1/3/12 3:51 PM, Sivakatirswami wrote:
> Without scripting every field, if you have a data entry system with
> multiple fields, and you want to flag the user that he or she made a
> change but did not save before click "next" or "Previous" to go to
> another record... what would be the simplest method to check that the
> card was modified to then prompt the user "Do you want to save your
> changes?"

In the card script (or stack script, depending on how the stack is laid 
out), trap the "closefield" message, which is only sent when field 
content changes. Set a script local or global variable to true. Then on 
closecard, check the variable and ask to save if it's true. Then set the 
variable back to false.

The only catch here is that if any of your fields have closeField 
handlers, they'd need to pass the message so that the card could catch it.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list