I have a document library with a custom DispForm.aspx page. In this library, I have a column with the option Append Changes to Text. The DispForm.aspx displays the information correctly by this code

<SharePoint:AppendOnlyHistory runat="server" FieldName="..." ControlMode="Display" ItemId="{@ID}"/>

Is there a way to have the DispForm.aspx page show the items, but not display the modified date and user who modified it?


The only way to do that would be to use javascript/jQuery. The code that you posted runs server side and you have no control over the output. You'll have to do some front-end manipulation after the page has been rendered. Hopefully, SharePoint gives you a good hook onto these elements, otherwise, it could be rather difficult.

Here's some jQuery to help you along:

// for the append-only comments, disable the click-to-view author and date

$("a[href*='_layouts/userdisp.aspx?ID=']").each(function(){ $(this).closest("span").replaceWith($(this).html()); }); $("a[href*='/Lists/MyListName/DispForm.aspx?ID=']").each(function(){ $(this).replaceWith($(this).html()); });


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.