Try our conversational search powered by Generative AI!

Episerver make field required based on selected value


Hi all,

We have a requirement like,

I have a news category dropdown on Episerver page type which is holding different options.

When cms editor selects one particular news category from options(User Alerts), the other field (Alert Text) which is the text editor, should make it a mandatory field before publishing.

And this (Alert Text) text editor field is not mandatory for other new category types.

How to achieve this requirement.

Appreciate your help. Many thanks in advance.

Sep 12, 2022 23:57

Could this article also help : Refresh current editing context on property value change ( 

It details how you can change the state of one property based on another. 

Sep 13, 2022 10:47

If you do not require the UI to change, and visually indicate that the other fields become mandatory, the easiest approach is to create a custom validator using the IValidate<T> interface.

Sep 13, 2022 12:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.