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?