Member
Member
nbruley   2026-10-31, 22:02
#1

HTML code such as < button onclick="window.location.href='/mypage.html" > gets the javascript onclick stripped after upgrading to the latest version. Is there a way to prevent this?

Also it looks like h2 turns into p
[hr]
I think the reason may be that the tinymce plugin isn't working for me for some reason; I don't see formatting options anymore.
[hr]
Update: tinymce wasn't the answer. I needed to enable the plugin. It still strips the javascript and changes headers to paragraphs on the site (though they remain in the description code area).
[hr]
** Update: Ugh. Disregard the Header to paragraph issue. That was indeed fixed by enabling tinymce. Only the javascript issue remains.

This post was last modified: 2026-10-31, 22:36 by nbruley.
Administrator
Administrator
acrylian   2026-11-07, 11:30
#2

Beside that our code uses it all over the place as well, it is not good practice to use attributes like onclick anymore (you will easily forgot you did as you will not really see it anywhere without source view). Try to use classes and attach the code to handlers. Do that via the theme or via a codeblock possible (theme might need changes for that).

If you really need to do this you might need to create your own tinymce configuration file that allows js code.

Member
Member
nbruley   2026-11-07, 19:25
#3

OK. I can replace it with links that look like buttons.

Administrator
Administrator
acrylian   2026-11-07, 19:45
#4

The js attributes of course don't work with links, too. A button the right element if you don't lead anywhere. But given your example that button should be a link right from the start ;-)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.