Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to edit a "new item" list form to allow it to fill in values sent as parameters in the querystring. The standard javascript methods work fine for most fields, but I'm absolutely stumped trying to insert data into an Enhanced Rich Text field. I know that MS provides a host of methods like RTE_GetEditorDocument(strBaseElementID), but these only appear to work for regular Rich Text fields, not Enhanced Rich Text.

The difference seems to be that with the regular Rich Text field, the formatting controls appear inline, while with Enhanced, they appear on the ribbon. With this enhanced version, it doesn't appear that there's anything I can use as a handle to get access to wherever the data is being stored. There isn't a single textarea on the page, nor an iFrame.

There's an input control with the attribute id="ctl00_m_g_f2b81200_9fde_4fc8_9b4e_973579d51926_ff81_ctl00_ctl00_TextField_spSave", which looks promising, but setting the value of this doesn't accomplish anything. There's also a div with id="ctl00_m_g_f2b81200_9fde_4fc8_9b4e_973579d51926_ff81_ctl00_ctl00_TextField_inplacerte". Sometimes the div has a p control attached to it, and sometimes not, seemingly at random, which also doesn't appear to do anything when I set its value.

EDIT: I think I'm most of the way there, but this seems remarkably resistant to editing. From the console, I can get the value to change by running the following:

document.getElementById(
  'ctl00_m_g_f2b81200_9fde_4fc8_9b4e_973579d51926_ff81_ctl00_ctl00_TextField_inplacerte'
  ).getElementsByTagName('p')[0].innerText = 'Test'

However, if I try to add that code to my script, it doesn't work -- even if I use that same code verbatim, without any variables. I get the error "Unable to set value of the property 'innerText': object is null or undefined", and after that, entering it from the console fails too, until I refresh the page. /EDIT

Does anyone know how to do this? I know I can always ditch the Enhanced Rich Text, and I will if I have to, but I'd love to figure out how to make this work.

Thank you!

share|improve this question
    
Do you ever resolve this? I am getting The value of the property 'RTE_GetEditorDocument' is null or undefined while trying to use javascript to access SharePoint spellchecker –  user14185 Jan 16 '13 at 17:02
    
No, I eventually just gave up on using the Enhanced Rich Text. Sorry I couldn't be more helpful! –  Jeff Rosenberg Jan 16 '13 at 20:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.