Reputation: 21
I have a collect task in Sharepoint 2010 with a Enhanced Rich Text box. In the list it shows the p and div tags.
<div class="ExternalClass1458740DC98941C3A3589359A3017AAA"><p>Approved - Rev D</p></div>
This is the field where the text is coming from.
<td width="75%" class="ms-formbody" >
<SharePoint:FormField runat="server" id="ff3{$Pos}" ControlMode="Edit" FieldName="DocCtlAdmin_x0020_Comment1234567" __designer:bind="{ddwrt:DataBind('u',concat('ff3',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)) , '@DocCtlAdmin_x0020_Comment1234567')}"/>
<SharePoint:FieldDescription runat="server" id="ff3description{$Pos}" FieldName="DocCtlAdmin_x0020_Comment1234567" ControlMode="Edit"/>
</td>
Any insight as to why or how to remove would be appreciated
Upvotes: 2
Views: 18326
Reputation: 11
Simple answer is: In your display view add disable-output-escaping="yes"
to your XSL statement like so:
xsl:value-of select="@CMImplPlan" disable-output-escaping="yes"
This will remove character output escaping for HTML characters.
Upvotes: 1
Reputation: 436
Issue is you are using RichHTMLField to get the input from your end users for this field. So sharepoint adds some HTML tag. but when you are displaying you are using FormField, which is text based, so it shows all the HTML tags also.
So solution is : 1. Use RichHTMLField for both input and display 2. Use FormField/ Simple textbox for both input and display 3. Write a custom control / control extender to clean all the HTML before outputting it 4. Also a less recommended solution will be to search this tags on page via jQuery and remove them.
Upvotes: 0