How do use RTE_ConvertTextAreaToRichEdit() function in a customized aspx page in SharePoint 2007?
I tried using a Javascript cleditor together with SPServices but could not get my data inside the rich text box to be store into the multi-lines text field inside a list.
Below are javascript code that I tried for reference only:
CODE A - cleditor
$(document).ready(function() {
$("#newWordDesc").cleditor();
});
CODE B - SPservices
$(document).ready(function() {
CreateNewItem($("#newWordDesc").val());
function CreateNewItem(newWordDesc) {
$().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "New",
listName: "MyList",
valuepairs: [["Description", newWordDesc]],
completefunc: function(xData, Status) {
$("#responseStatus").html(Status);
$("#responseXML").text(xData.responseXML.xml);
}
});
}
CODE C - HTML TextArea using Javascript
document.write('<textarea id="newWordDesc" wrap="soft"></textarea>');
Would appreciate if any insight provided.
Update (Based on Amit)
I modify Amit's code as follows and the RTE is now displayed correctly. (However, if one enter data into the RTE field, and submit into a SharePoint List via SPServices, it will not work.)
<script type="text/javascript" language="javascript" src="/_layouts/1033/form.js"></script>
<script type="text/javascript">
//To determine if browser is IE
$(document).ready(function() {
if (browseris.ie5up && browseris.win32 && !IsAccessibilityFeatureEnabled())
{
RTE_ConvertTextAreaToRichEdit("newWordDesc", true, false, "", "1033", null, null, null, null, null,"FullHtml", "\u002f",null,null,null,null);
}
// else render help link if browser is Non-IE i.e. chrome,firefox etc
else
{
document.write(" <br><SPAN class=ms-formdescription><a href='javascript:HelpWindowKey(\"nsfullrichtext\")'>Click for help about adding HTML formatting.</a></SPAN> <br>");
};
});
</script>