Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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()); });

share|improve this answer
    
Thanks, I modified the code and was able to hide it. –  sange Mar 11 '11 at 13:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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