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

Bob Sneidar bobs at twft.com
Tue Jan 3 17:29:52 EST 2012


Also remember that closeField does not get sent to a field if the user clicks on a button before exiting the edited field, at least on the Mac OS. 

Bob


On Jan 3, 2012, at 2:12 PM, J. Landman Gay wrote:

> 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
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list