We followed the code as per post -
Solved: Conditionally setting fields to mandatory - Power Platform Community (microsoft.com)
This works fine and we are able to show/hide a single text field (and also make it required) when another field is set to "Other" -
This is fine so far. But then I realized that since this is only a client side JS, this can of course be overidden.
I ran the following in the console and yes, the validation has disappeared. We run it multiple times until Page_Validators is emptied.
for (i = 0; i < Page_Validators.length; i++) {
Page_Validators.splice(i, 1);
}
On the other hand, if we use form metadata to make a field required, it not only adds to the page_validator but also checks at the server side.
Hence, we would like dynamic validations but at the server side. In our project we have done a lot of different client side javascripts based on recommendations from the community but we feel that is a big area of concern.

Report
All responses (
Answers (