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>");  
2
  • On which page are you trying to do this?
    – variable
    Commented Apr 29, 2014 at 5:07
  • It's not working in Sharepoint 2016 list multiple lines of text feild (Enhanced rich text ),how to solve this ?
    – user88074
    Commented Dec 16, 2019 at 12:17

3 Answers 3

1

try this

$('nobr:contains("your multiple line text field name")').closest('tr').find('div.ms-rtestate-write').text();
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);
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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