I have written a custom Javascript validation code and added it to the "Custom Javascript" field in the first form step of my multistep form, but it is completely ignored.
On step one of the form there are three "toggles" (YES/NO choice columns).
I need to prevent proceeding to the next step if none of the 3 toggles = Yes or True.
Is my code incorrect? Is there a setting that needs to be enabled for the custom Javascript to be used?
if (window.jQuery) {
(function ($) {
if (typeof (entityFormClientValidate) != 'undefined') {
var originalValidationFunction = entityFormClientValidate;
if (originalValidationFunction && typeof (originalValidationFunction) == "function") {
entityFormClientValidate = function() {
originalValidationFunction.apply(this, arguments);
var evA = $('#ev_a').is(':checked');
var evB = $('#ev_b').is(':checked');
var evC = $('#ev_c').is(':checked');
if (!evA && !evB && !evC) {
alert('Please select at least one ev type: EV A, EV B, or EV C.');
return false;
}
return true;
};
}
}
}(window.jQuery));
}