web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Conditionally setting ...
Power Pages
Unanswered

Conditionally setting fields to mandatory - Issue

(0) ShareShare
ReportReport
Posted on by 323

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" -

 

prathyoo_0-1715107333915.png

prathyoo_1-1715107370937.png

prathyoo_2-1715107432438.png

 

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);
					}

 

prathyoo_3-1715107536043.png

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.

 

 

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    For server side you would have to write them in Plugin code, or could use realtime Workflow's for very simple stuff.  If you do this you also need to set the site setting below to true, and in your plugin error output/throw a 'nice' message, (for Workflow Stop step as error with nice message) 

    Site/EnableCustomPluginError set to true

       

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 55

#2
11manish Profile Picture

11manish 48

#3
Valantis Profile Picture

Valantis 46

Last 30 days Overall leaderboard