The CreatorCon Call for Content is officially open! Get started here.

IS it possible to append onclick javascript funtion in HTML source code?

dvelloriy
Kilo Sage

Hi Community,

IS it possible to append onclick javascript funtion in HTML source code?

I am trying to append below code to my HTML source code field in knowledge base. But when i update it, it just strips it off. Is it not supported. Any suggestions to fix it>?

Trying to insert this code:

<div class=""SH_Toggle"" onclick=""document.getElementById('Brain_TR').classList.toggle('highlight_row');document.getElementById('Brain_Details_TR').classList.toggle('hide');document.getElementById('Brain_Details_TR').classList.toggle('active_details_row');"">
(More Information: <span style=""color:blue;"">Show/Hide&nbsp;⇵</span>)</div>

However when i update the page, it just strips it off to this code:

<div class=""SH_Toggle"">(More Information: <span style=""color: blue;"">Show/Hide&nbsp;⇵</span>)</div>
</div>

 

Any help on this would be appreciated..

Thanks.

 

1 ACCEPTED SOLUTION

dvelloriy
Kilo Sage

Issue is resolved.

Added this the attribute

tinymce_allow_all=true

View solution in original post

5 REPLIES 5

Nice one, glad you got it resolved. For anyone who stumbles upon this in the future, the official documentation on this is here:

https://docs.servicenow.com/bundle/london-platform-administration/page/administer/form-administratio...

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul