Hello,
I using a show/hide code depending on the answer to a previous question, the show/hide and mandatory logic all worked fine until the form was changed to a multi step form.
I am adding the code under the custom javascript section on the content page. where or what validation code do I use so that the form wont move on to the next page until the required questions have been answered. I was able to get the pop up error message to work but when i click ok it moved on the next step of the form anyway by default, how do I override this.
my code
$(document).ready(function() {
$("#ahitask_layp02secaq01").change(SetFieldsVisibilityQ1);
$("#ahitask_layp02secaq01").change();
});
function SetFieldsVisibilityQ1() {
var selectedValue = $("#ahitask_layp02secaq01").val();
if (selectedValue != null && selectedValue == "352230000") {
$("#ahitask_layp02secaq02_label").closest("tr").show();
$("#ahitask_layp02secaq02").prop("required", true).closest("tr").show();
$("#ahitask_layp02secaq03_label").closest("tr").show();
$("#ahitask_layp02secaq03").prop("required", true).closest("tr").show();
$("#ahitask_layp02secaq04_label").closest("tr").show();
$("#ahitask_layp02secaq04").prop("required", true).closest("tr").show();
} else {
$("#ahitask_layp02secaq02_label").closest("tr").hide();
$("#ahitask_layp02secaq02").prop("required", false).closest("tr").hide();
$("#ahitask_layp02secaq03_label").closest("tr").hide();
$("#ahitask_layp02secaq03").prop("required", false).closest("tr").hide();
$("#ahitask_layp02secaq04_label").closest("tr").hide();
$("#ahitask_layp02secaq04").prop("required", false).closest("tr").hide();
}