
Announcements
Hello! I'm pretty new to Power Pages and I've been back and forth with this code trying to figure out how I can set up my Power Pages form. I want to make it so that if a user chooses Holiday in one choice field, that it also selects "Holiday" in another choice field. This is the code I have so far:
Figured it out!
$(document).ready(function () {
$("#cr53b_otdateclassification").change(onDisplaySectionChange);
onDisplaySectionChange();
});
function onDisplaySectionChange() {
var varOTDateClassification = $('#cr53b_otdateclassification').find("option:selected").text();
var varOTClassification = $('#cr53b_otclassification').val();
if (varOTDateClassification === "Holiday") {
// You need to check the HTML on your Power Pages site and look for the option number. Power Pages Custom JS doesn't recognize the text values, so you need to reference the option # value.
$('#cr53b_otclassification').val('872150002');
}
}