Bill Crews wrote:
It would be WAY helpful to simply state that what is desired/proposed is a scripted event, ..., SUCH AS WHEN FOCUS IS MOVED FROM A FIELD THAT HAS CHANGED...Why not be clear about what is proposed?
Well, the subject of the thread is "Trigger for JavaScript on field change?", so I thought that was clear from the start. :)
I think what happened in this discussion is that you're
thinking about the term "trigger" which has been defined for Memento as
only applying to an Entry object. I'm seeing Trigger and Event as being
synonymous, and applying to Fields and Entries.
All other UI design tools support events like:
OnFocusChanged for the form
OnFocus and OnLostFocus for specific controls
OnChanged for controls
Note that Focus is different than Changed. And there is a difference between when focus is moved To a control and when it is moved Away from a control. It's common to have to process multiple events in sequence: Changed, then LostFocus from the current control, then OnFocus to the next control.
Sure, I'd like to see focus events too, but this specific request is only about a Field Changed event.
That brings up a request, sooner or later, for cascading change events. For example, is a "change" only a UI change, or is it actually the change in value of a field within an entity. I'd prefer the latter. The difference is that a UI change event would only fire if a user typed a number as a quantity, for example, and then transitioned away from that control. But if that field has an associated change event, it could trigger the recalculation of a running total, which is not manually changed, but which could have its own field changed event which takes some action.
I believe "intra-card" and "phase", while helping to be explicit here, are an unnecessary introduction of new terms, where industry standards include "field event" and "control event", compared to "form event" or "record-level event".
Overall I believe we're on the same page now. I just wish we could move as quickly toward enhancements to support the concepts. :)
Regards and Thanks.
T