+ Start a Discussion
Ron WildRon Wild 

Rich Text Field strips out style, class attributes

In playing with the new Rich Text field, we've found that you cannot use the field to store html with style or class attributes ... these are stripped out automatically.


There is also no way to edit the content as html, or add <h> tags, <table>, floats etc.


Does anyone know if there are plans to allow developers to enable these?  Possibly through the field definition or as attributes on the <apex:inputField> tag?


It's too bad really, as the ability to see the rich text controls while a record is in edit mode is a much better user experience than we've been able to achieve with our own FckEdit component.






I know there are things that are stripped which are documented in the online help. If you are seeing more than that please log a case.  I know, for example, that style values that contain float are stripped but those that don't should not be.   This is considered a bug and it is logged but no ETA, if you create a case it will help change that.


There are no plans to make the toolbar of the RTE configurable at this time - either in the standard UI or as a component in Visualforce. It's been discussed but is not a priority currently.


You can utilize your own RTE in a Visualforce page which you can bind to an RTA (Rich Text Area) but are subject to the stripping/float issues.   The benefit to the RTA in this case is the security treatment (the other side of the double-edged sword), the search indexing treatment and the display behavior of the field in the rest of the standard UI.