Question

I'm working with the tinymce editor and am having a bit of trouble. I'm trying to do some validation so I was using a onKeyUp to validate, but it immediately gives the user an error when you tab into the field. I would like to fix this by trying to do something like an onFocusOut so that the errors only show up when you click out of the box.

So far I have this

ev.onInit.add(function(ev, evt) {
    tinymce.dom.Event.add(ev.getDoc(), 'blur', function(e, t) {
       alert('Worky Work Work!');
    })
)

but it's only working in firefox. I really need it to work in Chrome and Safari, but I have been unable to find what is needed for that. Help would be much appreciated! :)

Was it helpful?

Solution

You should apply the blur handler to the editor iframe body instead of the iframe document. Here is the link to a working fiddle: http://fiddle.tinymce.com/kCcaab/1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top