Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: Clearing text in CuteEditor using javascript
Clearing text in CuteEditor using javascript
Last post 09-02-2010, 5:05 AM by
vijayan59
. 2 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
09-02-2010, 3:36 AM
63805
vijayan59
Joined on 08-30-2010
Posts 4
Clearing text in CuteEditor using javascript
Reply
Quote
Hi Experts,
i want to clear the text field in CuteEditor when clear button is clicked.
so can u pls help me to solve this issue.
thanks in Advance
regards,
vijayan
09-02-2010, 4:05 AM
63806
in reply to
63805
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Clearing text in CuteEditor using javascript
Reply
Quote
Hi vijayan59,
Please try the example below
<%@ Page Language=
"C#"
%>
<%@ Register Assembly=
"CuteEditor"
Namespace=
"CuteEditor"
TagPrefix=
"CE"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head id=
"Head1"
runat=
"server"
>
<title>GetPlainText</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<CE:Editor ID=
"editor1"
runat=
"server"
>
</CE:Editor>
<div id=
"plainText"
style=
"visibility: hidden"
>
</div>
</form>
</body>
</html>
<script>
function CuteEditor_OnCommand(editor,command,ui,value)
{
if
(command==
"CleanCode"
)
{
cleanTHML();
return
true
;
}
}
function cleanTHML()
{
var editor1=document.getElementById(
'<%= editor1.ClientID %>'
);
var plainText=document.getElementById(
"plainText"
);
plainText.innerHTML=editor1.GetHTML();
editor1.SetHTML(plainText.innerText)
plainText.innerHTML=
""
;
}
</script>
Regards,
ken
09-02-2010, 5:05 AM
63808
in reply to
63806
vijayan59
Joined on 08-30-2010
Posts 4
Re: Clearing text in CuteEditor using javascript
Reply
Quote
Hi Mr.Ken.. its working , thank you very much for ur help..
hope to continue this in future :-)
thank you
regards,
vijayan