2

I am trying to set default value to "enhanced rich text box" of a list in sharepoint 2010. A similar question is being answered here Update a rich text column in Sharepoint using jquery

Found this code (https://stackoverflow.com/a/13158954/1826736)

$('td.ms-formbody').each(function(i, item) {
item = $(item);
if (item.html().indexOf('FieldName="' + fieldName + '"') > -1) {
    item.find("div[contenteditable='true']").html(newValue);
    //break
    return false;
}
});

The above piece of code smartly does the job in 2010 environment but somehow the default value appears and then disappears in a fraction of second. My guess is that as soon as "editing tools" appear for enhanced rich text box control, they wipe out its default content. I am executing this code from within Document.ready. Please help me fix the issue. A similar code works fine in sharepoint 2007 but not sure why Sharepoint 2010 is behaving like this.

Community
  • 1
  • 1
Prabhash
  • 73
  • 9

0 Answers0