I have a Javascript variable that contain HTML code as follows:
<DIV>Hello World<BR>Welcome to SharePoint Stack Exchange</DIV>
So, how do I insert it into the SharePoint 2007 Multi line text field (The meaning of a SharePoint 2007 Multi Line text field is shown in the picture below)?
For your info, I have tried using SPServices to insert that piece of HTML code but it just cannot insert into the SharePoint text field. However, if I use escape()
, I am able to insert into the text field but the text is not what I wanted.
Any Insight?
[Update - Additional Information]
I typed the following into the textarea called "newWordDesc" in CODE A
<DIV>Hello World<BR>Welcome to SharePoint Stack Exchange</DIV>
and with the help of CODE B, it is supposed to store it into a field called "Description" inside SharePoint 2007.
CODE A - HTML TextArea using Javascript
document.write('<textarea id="newWordDesc" wrap="soft"></textarea>');
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); } }); }
Would appreciate if any insight provided.