1

We have a Rich Text field where we are storing our email's html.

When i try to save the item, i ended up with validation error like

The field "EmailBody" contains (or lacks) some formatting attributes which can cause unexpected results in some browsers (such as Internet Explorer, Firefox, or Safari). For more information about the specific issue detected, use to the Validation command in the Proofing group on the Review tab.

when i checked by clicking on validation button the error is:

Field must be a valid XHtml document Error: The element 'div' in namespace 'http://www.w3.org/1999/xhtml' has invalid child element 'meta' in namespace 'http://www.w3.org/1999/xhtml'. List of possible elements expected: 'p, h1, h2, h3, h4, h5, h6, div, ul, ol, dl, pre, hr, blockquote, address, fieldset, table, form, a, br, span, bdo, map, object, img, tt, i, b, big, small, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, input, select, textarea, label, button, noscript, ins, del, script' in namespace 'http://www.w3.org/1999/xhtml'. [2, 4]

I want to suppress that error on specific field("EmailBody") not a global change for rich text field, how can i achieve this?

5

You can remove the rule validation on the Global Rules item /sitecore/system/Settings/Validation Rules/Global Rules

You'll want to remove the rule from the Validate Button, and Validate Button fields of the item.

enter image description here

Update

There are field specific rule items that you can update to remove the Is XHtml if needed. The Rich Text field is located at /sitecore/system/Settings/Validation Rules/Field Types/Rich Text

  • is it possible to remove validation on specific field, i am not after a global change? – Dheeraj Palagiri Jan 12 '17 at 16:40
  • I've updated the answer to also include how to remove the "Is XHtml" rule for just the Rich Text field. Note that once that is removed, you will most likely still run into the "Full page XHtml" rule if the html in the rich text field or renderings is not valid. – Patrick Barron Jan 12 '17 at 17:03
  • Is there any kind of optimization we can do rather than removing the xhtml validator? – jithin Dec 4 at 11:48

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.