MyBB Community Forums

Full Version: myCode shows in preview but not post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have a custom [spoiler] myCode. When I use the code, it shows fine in the post preview. However, when I submit the post. It does not show.

The code:
\[spoiler\](.*?)\[/spoiler\]

<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input class="button2 btnlite" type="button" value="View Spoiler" style="text-align:center;width:115px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      this.innerText = ''; this.value = 'Hide Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'View Spoiler'; }" /></div><div class="quotecontent"><div style="display: none;">$1</div></div></div>

In the preview:
[Image: rM2IwXM.png]

In the post:
[Image: iQVohfc.png]

Can someone help me figure to get this working? Thank you,