Print Page | Close Window

Clear the editor with javascript

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Rich Text Editor (RTE)
Forum Description: Support forum for the Web Wiz Rich Text Editor (RTE).
URL: https://forums.webwiz.net/forum_posts.asp?TID=25812
Printed Date: 28 March 2026 at 7:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Clear the editor with javascript
Posted By: tpigarret
Subject: Clear the editor with javascript
Date Posted: 10 June 2008 at 6:27pm
Hi all i implemented your editor on a website and i would like to put a button on the page where you click it, the html editor will be clear or equal to "" no html tags left over no nothing. i tried to make a javascript function that clears it to no prevail.  is there a specific way to clear it please let me know
 
thanks



Replies:
Posted By: tpigarret
Date Posted: 10 June 2008 at 7:39pm
never mind i figured it out on my for future reference to anyone this is what i have and seems to work fine:
 
function clearEditior()
{
 var editor = document.getElementById('WebWizRTE').contentWindow.document;
 editor.body.innerHTML = "";
 document.form1.paragraphBody.value = "";
 alert(document.form1.paragraphBody.value);
}
 
where paragraphBody is my textareas name


Posted By: jamie.townsend
Date Posted: 11 June 2008 at 7:42am
Thanks for sharing with everyone !



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net