onclick removed
onclick removed
Hello, When entering onclick in a tag (e.g., <button type="button" onclick="do_something()">Click me</button>), the onclick part gets removed on saving the content. All that's left is <button type="button">Click me</button>. It stays in a template but not when entering the code in a content box. Has anyone seen this before? Is there a workaround? Thanks.
Re: onclick removed
Scripts shouldn't be added in wysiwyg content areas, and the default setting of those editors is to strip it out. It's likely possible to disable that in the MicroTiny config (you can check their docs) but not really ideal.
Various options:
-Put the script in a generic template for the users to add with {include file='cms_template:myscript'} or similar
-Add a non-wysiwyg content block or disable the wysiwyg entirely for that page
-don't use onclicks, add the script to your template and have it tiggered by the class/id of the link
Various options:
-Put the script in a generic template for the users to add with {include file='cms_template:myscript'} or similar
-Add a non-wysiwyg content block or disable the wysiwyg entirely for that page
-don't use onclicks, add the script to your template and have it tiggered by the class/id of the link
Not getting the answer you need? CMSMS support options
Re: onclick removed
Thank you for the explanation and pointing me in the right direction.