On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

DCT: TinyMCE Rich Text Field - onItemChange not triggering on Save

I have a DCT that requires the user to click on a callout button any time the user changes any of the data in the form.  The callout does some behind-the-scenes validation of the data and some other fun stuff.  I have the typical "onItemChange" event handlers set up for each form field, and it's working as expected, except for rich text fields (TinyMCE).  When I modify a standard text field (not TinyMCE) and then click Save, the onItemChange event is triggered and it displays a pop-up telling the user they need to first click the Validate button (the callout).  However when a rich text field is modified (TinyMCE) and then the user click Save, the Save event just does the Save functionality.  The onItemChange function is never called.

 

This is a huge bummer.  I can't quite figure out a workaround yet.  I have opened a case - this smells like a bug to me.  But I need this to work in the meantime.  I have tried to use the item.oldValue property to compare that value to item.getValue(), but item.oldValue is coming back as "undefined".  

 

Has anyone had to deal with this?  Any ideas on how to hijack the Save process and figure out if the TinyMCE fields have changed since the form was opened?

 

EDIT: This seems to be happening in Firefox only.  And if I change something in the rich text entry field, then change the focus to another form field (not changing any data, just clicking inside another field), then clicking Save invokes the onItemChange event handler for the original rich text field.  Weirdness. 

 

EDIT 2.0: We found a workaround by saving the value of all rich text fields upon form entry, then on the Save event, see if the current values are different for any of the rich text fields.  If any are different, handle it.