Step 1: Add Required and Min length validators to a LONG TEXT field
In this step we will:
- make the Description field required.
- set the minimum length for the input the Description field to 20 characters.
-
From the Side Menu, Click Content Modeling > Models.
The Content Models screen opens.
- Hover over the Product content model.
-
Click Edit.
Screen to configure the Product content model’s fields opens.
-
Click the Edit Field icon on the Description field.
Field Settings - Long Text screen opens.
- Click the Validations tab.
-
Enable the Required validation by toggling the Enabled button. This will make the Description field mandatory.
Message textbox will appear to set the error message.
- In the Message textbox, type Please enter the product description.
-
Enable the Min length validation by toggling the Enabled button.
Message and Value textboxes will appear to set the error message and minimum value.
- In the Message textbox, type Description cannot be less than 20 characters.
- In the Value textbox, type 20.
-
Click Save Field.
Screen to configure the Product content model’s fields opens.
-
Click Save.
The message “Your content model was saved successfully!” displays.
Step 2: Test the validators
- On the screen to configure the Product content model’s fields, click the Preview tab.
- Click the Description textbox.
-
Click anywhere outside the Description textbox.
The message “Please enter the product description” appears.
- In the Description textbox, type Top sweatshirt.
-
Click anywhere outside the Description textbox.
The message “Description cannot be less than 20 characters” appears.

