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

Community site session details

Session Id : 5VBW5J875dJWrnmP05eQMd
Power Pages - General Discussions
Unanswered

Dynamic validation

Like (0) ShareShare
ReportReport
Posted on 17 May 2023 13:01:02 by

Hello everyone,

 

i'm busy making a multistep form and i encounter the following. i have 4 dropdown menu's dropdown 2,3 and 4 are hidden. based on the selection of dropdown 1, one of the others shows visible. and i used this video for my problem Using JavaScript in Power Apps Portals to Hide and Show Fields - YouTube

 

what i want, is that the field that is visible field should be a required field and the hidden fields are not required.

 

below is the code i have now.

 

 

$(document).ready(function () {
 $("#dropdown_1").change(onDisplaySectionChange);
 onDisplaySectionChange();
});

function onDisplaySectionChange() {
 var varadvies = $('#dropdown_1').find("option:selected").text();
 var verplicht = $('#dropdown_2');

 if (varadvies === "option_1") {
 $('#dropdown_2').parent().parent().show();
 } else {
 $('#dropdown_2').parent().parent().hide();
 $('#dropdown_3').val('');
 $('#dropdown_4').val('');
 }

 if (varadvies === "option_2") {
 $('#dropdown_3').parent().parent().show();
 } else {
 $('#dropdown_3').parent().parent().hide();
 $('#dropdown_2').val('');
 $('#dropdown_4').val('');
 }

 if (varadvies === "option_3") {
 $('#dropdown_4').parent().parent().show();
 } else {
 $('#dropdown_4').parent().parent().hide();
 $('#dropdown_2').val('');
 $('#dropdown_3').val('');
 }
}

 

I tried a few things and searched the forums. and i found (i think) some answers but i am doing something wrong, but i cant figure it out

 

can someone help me out with this?

Categories:
I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2

Loading complete