Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: Moving the editor in the DOM
Re: Moving the editor in the DOM
06-22-2009, 4:57 AM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Moving the editor in the DOM
Reply
Quote
Hi,
Try this way
<%@ Page Language=
"C#"
%>
<%@ Register TagPrefix=
"CE"
Namespace=
"CuteEditor"
Assembly=
"CuteEditor"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<script runat=
"server"
>
</script>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head id=
"Head1"
runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div id=
"placeholder1"
>
<span id=
"span1"
onclick=
"edit('placeholder1')"
>editable content 1</span>
<CE:Editor ID=
"Editor1"
runat=
"server"
EnableStripScriptTags=
"false"
Style=
"display: none"
/>
<input type=
"button"
value=
"save"
onclick=
"save1()"
id=
"save"
style=
"display: none"
/>
</div>
</form>
</body>
</html>
<script>
var span1 = document.getElementById(
"span1"
);
var save = document.getElementById(
"save"
);
var dynEdit = document.getElementById(
'<%= Editor1.ClientID %>'
);
var cache = span1.innerHTML;
function edit(instance)
{
span1.innerHTML =
''
;
dynEdit.style.display=
"block"
;
save.style.display=
"block"
;
dynEdit.setHTML(cache);
dynEdit.FocusDocument();
}
function save1()
{
span1.innerHTML=dynEdit.getHTML();
dynEdit.style.display=
"none"
;
save.style.display=
"none"
;
}
</script>
Regards,
ken
View Complete Thread