Having trouble with field validations in Experience editor??



Yes, it's really bit frustrating to content authors when few things are wasting their time if they try to add content using experience editor.

When you are developing a website in Sitecore, it's best practice to have enabled in experience editor.
In recent days, I have had a look in one of the features with regex field validations.

Its really easier to a developer who can play with regex expressions and save time.

I have seen some of complex expression only for multi-list field i.e selecting limited no. items fro the available list. Ex: ^({[^}]+}[|]{[^}]+}[|]?)*$


Usually, these validations work seamlessly in the content editor. whereas when it comes to experience editor, its pain part and blocks user to save field value to valid.

If you looking for a fix of similar issues.Well, in that case, you have to add below workaround. Because, its Sitecore BUG. 



Yes, Sitecore has reported this issue as BUG and provided workaround fix as below.


comment out the following processor in your 'App_Config\sitecore.config' file:

"processor mode="on" type="Sitecore.Shell.Applications.ContentManager.ReturnFieldEditorValues.RegexValidate"

The Sitecore.Shell.Applications.ContentManager.ReturnFieldEditorValues.RegexValidate processor is a part of the uiReturnFieldEditorValues pipeline. 
The RegexValidate processor must check fields with a regular expression validation when you click the Ok button in your Edit Form. If the result is invalid, a pop-up with the validation message will appear.

So, in this case, the multi-list field will not be validated when you will edit multi-list field in Experience Editor and click OK button. But will be validated when you will click on Save button, and an error message will appear if any field does not meet the regular expression.


For future reference, Please reach out to Sitecore with #49573.

Comments