Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for PHP
»
How can I make the text property render html?
How can I make the text property render html?
Last post 06-05-2011, 9:44 PM by
Kenneth
. 1 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
06-05-2011, 12:46 PM
67811
davideo7
Joined on 06-03-2011
Posts 12
How can I make the text property render html?
Reply
Quote
I'm talking about this:
$editor->Text="$message";
If my $message contains html, how can I make the html render? Because currently it doesn't, it just shows the html tags in the post. I need this for when users go to edit their posts.
06-05-2011, 9:44 PM
67812
in reply to
67811
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: How can I make the text property render html?
Reply
Quote
Hi davideo7,
You should encoding you html and than paste into editor.
Please try the example below.
<?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>
<html>
<head>
<link rel="stylesheet" href="php.css" type="text/css" />
</head>
<body>
<form name="theForm" action="Get_HtmlContent.php" method="post" ID="Form1">
<h1>Enable All Toolbars</h1>
<p>This example shows you all the predefined buttons. </p>
<br />
<?php
$editor=new CuteEditor();
$editor->ID="Editor1";
$editor->Text="Type here";
$editor->EditorBodyStyle="font:normal 12px arial;";
$editor->EditorWysiwygModeCss="php.css";
$editor->Draw();
$editor=null;
//use $_POST["Editor1"]to retrieve the data
?>
<input type="button" value="Encoding" onclick="ecding()" />
</form>
</body>
</html>
<script>
function ecding()
{
var editor1 = document.getElementById('CE_Editor1_ID');
var code="<div>test</div>";
code= code.split("&").join('&').split('<').join('<').split('>').join('>');
editor1.setHTML(code);
}
</script>
Regards,
ken