How to fix TinyMCE to allow onclick in hyperlinks?

2 years ago
Hi-

I know it isn't possible to add scripts to the content area of a TinyMCE editor, but I just need to use an onclick event in a hyperlink in the body of a topic page to open a custom menu, like:
<a href="#" onclick="BootSideMenu()">This is the link</a>


The onclick disappears whenever I go from Source Code view back to normal view as if it were a script.
Is there any way to prevent this?

Thanks!
2 years ago
Hello Embryo,

Look at this http://fiddle.tinymce.com/mAdaab/1

Hope it will help you.

Thanks,
Jatin
2 years ago
embryo wrote:
Hi-

I know it isn't possible to add scripts to the content area of a TinyMCE editor, but I just need to use an onclick event in a hyperlink in the body of a topic page to open a custom menu, like:
<a href="#" onclick="BootSideMenu()">This is the link</a>


The onclick disappears whenever I go from Source Code view back to normal view as if it were a script.
Is there any way to prevent this?

Thanks!


You should change following setting to True
adminareasettings.richeditorallowjavascript