Get or set a SharePoint multiline textfield via jQuery

If you want to get or set a SharePoint multiline textfield in SharePoint via jQuery it is no big deal. Just use this code:

Set a SharePoint multiline textfield

$("textarea[Title=’Name of my field’]").closest("span").find("iframe[Title='Rich Text Editor']").contents().text(“<div>demo text</div>”);

Get a SharePoint multiline textfield

Var Variable1 =  $("textarea[Title=’Name of my field’]").closest("span").find("iframe[Title='Rich Text Editor']").contents().text();

About: Marijn

Marijn Somers (MVP) has over 14 years experience in the SharePoint world, starting out with SP2007. Over the years the focus has grown to Office 365, with a focus on collaboration and document management. He is a business consultant at Balestra and Principal Content Provider for "Mijn 365 Coach" that offers dutch employee video training. His main work tracks are around user adoption, training and coaching and governance. He is also not afraid to dig deeper in the technicalities with PowerShell, adaptive cards or custom formatting in lists and libraries. You can listen to him on the biweekly "Office 365 Distilled" podcast.


4 thoughts on “Get or set a SharePoint multiline textfield via jQuery”

  1. my input field of the form gets locked after using this to set some pre-determind text on the form . is there a way to unlock the form ?

    1. Hi Joanne,
      Never encountered that behavior before. Could you email me with more details ? Could you send me the code and the behavior? You can’t enter text anymore ?

    1. hmmm..what kind of multiline text field are you using? Perhaps try another variant if that is an option ?

Leave a Reply

Your email address will not be published. Required fields are marked *