Hello all. I'm having a problem with javascript event handlers inside the FCKeditor.
I can trap events caught by FCKedit itself (mousedown, onclick, etc for any click on the editor itself).
However I want to add event handlers for form objects I have *inside* the textarea. Say, an INPUT field for example.
Has anybody been able to do this programatically? Or even hardcoded in the HTML itself?
If I have this in the content of the editor, the onclick event seems to just be ignored.
<input id="test" onclick="alert('clicked!')">
Any help is appreciated!
I can trap events caught by FCKedit itself (mousedown, onclick, etc for any click on the editor itself).
However I want to add event handlers for form objects I have *inside* the textarea. Say, an INPUT field for example.
Has anybody been able to do this programatically? Or even hardcoded in the HTML itself?
If I have this in the content of the editor, the onclick event seems to just be ignored.
<input id="test" onclick="alert('clicked!')">
Any help is appreciated!
RE: JS event handlers for form objects inside FCK
RE: JS event handlers for form objects inside FCK
To access the actual event object, you need to use this in your event handler:
var event = objContent.DOM.parentWindow.event; // here is the trick !
From there you can access event.srcElement, and that's the target of the event.
Thanks to the original poster! =)