The default validation rules
You can find some sample validation rules
/sitecore/system/Settings/Validation
Rules/Field Rules/Sample
We can duplicate the sample item for creating new one
Case 1:
I like to
set the required option to my field
Case 2:
I like to
set the required and maximum length of the field
I’ll add maximum 40 to my field
Let’s check the validation
I have given the field more than 40
But it allows me to save the page
Case 3:
I would like to stop my user to save the page when they have
errors in the item
Go to your rule path
/sitecore/system/Settings/Validation Rules/Field
Rules/Sample/Max Length 40
Parameters : MaxLength=40&Result=FatalError
Let’s test
Case 4:
I don’t like to give the error popup just like to show the
warning
Parameters : MaxLength=40&Result=Warning
Case 5:
I like to show an error when the field has
exceeded the length and would like to allow the user to save the item without
fixing it
Parameters: MaxLength=40&Result=CriticalError
How to add the Custom validation Custom rule-Ignore past date
No comments:
Post a Comment