2

Im trying to set default text using jquery on a mentioned field type. I can briefly see my text as I open a new form, but then it disappears. I tried various methods - .text() .html() .append() but i get the same result. How can I set that field?

$(".ms-rtestate-write").html("lots of text");
$(".ms-rtestate-write").append("<p>Test</p>");  
  • On which page are you trying to do this? – variable Apr 29 '14 at 5:07
  • It's not working in Sharepoint 2016 list multiple lines of text feild (Enhanced rich text ),how to solve this ? – user88074 Dec 16 '19 at 12:17
1

try this

$('nobr:contains("your multiple line text field name")').closest('tr').find('div.ms-rtestate-write').text();
| improve this answer | |
1

Well every other method still didn't work. SharePoint just wipes the text when the form loads. So I created a button which adds the default text when user clicks it.

var templateText = "teeeeeext";
$(".ms-rtestate-write").parent().parent().append("<input id=\"templateLink\" type=\"button\" value=\"Incident Template\">");
$(".ms-rtestate-write").html(templateText);
| improve this answer | |
0

Try this code:

var systemDescriptionRTETextArea = $("textarea[Title='System Description']");
$(systemDescriptionRTETextArea).html("paste your text here");

OR

    $(document).ready(function() {    

    $('nobr:contains("Desc")').closest('tr').find('input[id$="TextField_spSave"]').val('Hello World !!!');
    });

OR

$('nobr:contains("Rich Text")').closest('tr').find('input[id$="TextField_spSave"]').

val('<table border="1"><tr><td>Hello </td><td><b>World !!!</b></td></tr></table>');

try and give your feedback.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.