Include Conditional Comments in HTML Fields

With the new AllowConditionalComments attribute for the Html element, you can now allow users to enter conditional comments in form fields that accept formatted HTML text.

Within HTML, conditional comments allow you to specify different content for different versions of Internet Explorer, ranging from versions 5 through 9. This allows you to address legacy issues and differentiate Cascading Style Sheets rules for different versions of Internet Explorer. Conditional comments start with <!--[if expression]>, followed by HTML for when the if condition is met, and then <![endif]-->. For example, you can use a series of conditional comments to specify different content for Internet Explorer 5 and 6, Internet Explorer 7, and Internet Explorer 8 and 9:

<!--[if lt IE 7]>
  <p>Content specific to Internet Explorer 5 and 6.</p>
<![endif]-->
<!--[if IE 7]>
  <p>Content specific to Internet Explorer 7.</p>
<![endif]-->
<!--[if gt IE 7]>
  <p>Content specific to Internet Explorer 8 and 9.</p>
<![endif]-->

Note: Conditional comments are no longer supported as of Internet Explorer 10. For more information on conditional comments, see Microsoft's guidance.

When you set the new AllowConditionalComments attribute to "true" for an HTML field in Blackbaud CRM, users can now include conditional comments within that HTML field to specify different content for different versions of Internet Explorer. By default, the AllowConditionalComments attribute is set to "false."

Within the FormMetaData element on data form specs, you can create HTML fields in either the FormFields or UIFields elements. Within both elements, the child FormField element describes how to represent a single field on a data form. And within the FormField element, the Html element indicates a field that accepts formatted HTML text.

Note: Form fields represent input into the system and are also used in areas other than data forms, such as data lists and search lists.

<common:FormMetaData>
<common:FormFields>
<common:FormField FieldID="FIELD1" Caption="Field 1" DataType="String" MaxLength="10" />
<common:FormField FieldID="FIELD2" Caption="Field 2" DataType="String" MaxLength="20" />
<common:FormField FieldID="HTMLFIELD" Caption="HTML field" Description="Field that accepts formatted HTML text" >
<common:Html AllowConditionalComments="true"></common:Html> </common:FormField> </common:FormFields>
</common:FormMetaData>

Tip: For more information about the Html element, see Html Element.