3

We were trying to create a SharePoint List based on a spreadsheet, a few columns in the spreadsheet has bulleting/numbering.

SharePoint List is updated with the details from the Excel, however it shows HTML tags when we try to edit the list item.

Is there a way to remove these HTML tags and persist the bulleting/numbering formatting?

eg:

<font size="1"> ·&nbsp;&nbsp;Sharepoint reorganized</font><br /><font size="1">·&nbsp;&nbsp;&nbsp;Outstanding bugs - tracking and providing updates</font><br /><font size="1">·&nbsp;&nbsp;Attended meetings</font>
  • What type of field is it? The bulleting/numbering is going to require a rich text field type. But it sounds like when you are editing, SharePoint is not using the rich editor. – Robert Kaucher Feb 5 '14 at 17:56
  • This may help - clintoncherry.wordpress.com/2008/02/27/… – Karthikeyan Feb 5 '14 at 21:24
  • this is strange, it works fine on IE however still Firefox shows the HTML Tags while trying to edit the items. – Karthikeyan Feb 5 '14 at 21:30
  • Have you tried to create a event receiver for the updated event yet? You can create your custom code using the regular expression to remove the html tags. – MikeTran13 Feb 6 '14 at 3:04
3
+50

I have fixed this issue in the past with a little bit of client side code - basically some javascript that will turn that HTML into a rich text editor, just like in IE. Its not that hard and only takes a few minutes to apply it to the Edit and New forms. And: you don't need to be a sys admin. As long a you can design the forms (ex: your in the Site Owners group) you can do this using a Script Editor webpart.

Look into TinyMCE a free javascript solution. I believe it's also available via cdnjs, so you don't even need to store your own copy.

Solution

Here is a solution that should work (you will need to test it). This assumes that you know how to insert a Content Editor Webpart into a OOB Sharepoint form and how to set that up to pull in content from another file. That external file should contain the code below

<script type="text/javascript" src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script type="text/javascript">
    if (!browseris.ie) {

        tinymce.init({selector: 'textarea[title="TITLE_OF_COLUMN_HERE"]'});

    }
</script>

Replace TITLE_OF_COLUMN_HERE with the title of the real column. Note that due to a recently introduced change by MS, if this column is required and you have that "fix" installed in your environment, you may need to add the words "Required Field" to the column name (thus becoming "TITLE_OF_COLUMN_HERE Required Field").

I ran this in SP2007 from the Console and it worked for me on a column named Body (announcements list)...

Once you have that working, you can play with the many-many options TinyMCE offers on input. Go here: http://www.tinymce.com/index.php

  • Can you please let me know how to use this? – Karthikeyan Feb 12 '14 at 20:14
  • I updated my response with a proposed solution - sorry I forgot to post a comment when I did it. – Paul T. Feb 13 '14 at 16:24
  • I may need your assistance: <script type="text/javascript" src="/manual/enduserTeamSite/SiteAssets/tinymce.min.js"></script> <script type="text/javascript"> SPB4$(document).ready(function() { if (!browseris.ie) { tinymce.init({selector: 'textarea[title="Accomplishments"]'}); } }); </script> which turns the Accomplishments empty and grayed out in SharePoint 2010. – Karthikeyan Feb 14 '14 at 16:49
  • Any errors in the browser console? I see you installed it locally... I hope you installed the entire package of TinyMCE - its very large... Also, is your code in the <head> of the page or <body>? Have you tried with the cdn version? – Paul T. Feb 14 '14 at 17:01
  • how to install the entire package, have just upload the tinymce.min.js file on the document library, sure will give a try with the CDN version and update you. – Karthikeyan Feb 14 '14 at 18:26
4

This is normal behavior in Rich Text fields in SharePoint 2007/2010. The reason is that the Enhanced Rich Editor control in versions before 2013 did not support browsers other than IE and for that reason other browsers get downgraded to a regular text box and since the value of the field is HTML, other browsers see the HTML code rather than the editor.

Telerik offers a rich text editor for SP 2010 that is cross browser. I believe it's free but I'm not sure. It is a comercial product. Please note I have no affiliation with them. I have used the control and my users have never reported any issues with it. http://www.telerik.com/products/aspnet-ajax/sharepoint-web-parts.aspx

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.