Question

I'm trying to set a default value on the check in comment in a list in order to guide users to format their comments a certain way. I'm seeking a solution that will work on Sharepoint online.

Was it helpful?

Solution

Serve Side approach:

Create a custom file based on "_layouts/[15]/checkin.aspx" file and add the default value for the comments field. Additionally, to tie this to a particular list, create a custom action(one for Ribbon and one for ECB) that would open your custom "custom-checkin.aspx" file.

JavaScript approach:

function addCommentDefaultValue() {
 if (document.URL.indexOf('checkin.aspx') != -1) {
    // For check in description
    $("#CheckinDescription").text("Some default text goes here.");
    // For version comments
    $("textarea[id$='CheckInComment']").text("First line\nSecond line\nThird line.");
 }
}

$(document).ready(function () {
    addCommentDefaultValue();
});
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top