Created
December 10, 2014 21:06
-
-
Save awhedbee22/3c227f8e7bcd1637fa0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function () { | |
var forEach = function (array, callback, scope) { | |
for (var i = 0; i < array.length; i++) { | |
callback.call(scope, i, array[i]); // passes back stuff we need | |
} | |
}; | |
var highRiskCheckboxValidator = function () { | |
var numberOfCheckBoxesChecked = $(".high-risks input:checked").length; //number of checked boxes | |
if(numberOfCheckBoxesChecked >= 2) {//|| $("#Singled input").is(":checked")) {//greater than or = 2 or neosez checked | |
$('input#yes').prop('checked',true); //Enable input yes | |
} else if(numberOfCheckBoxesChecked < 2){// || $("#Singled input").is(":not(:checked)")) { //less than 2 or neosez unchecked | |
$('input#yes').prop('checked',false); //Disable input yes | |
$('input#no').prop('checked',true); //Enable input no | |
} | |
}; | |
highRiskCheckboxValidator(); | |
$(".high-risks input[type=checkbox]").on("click", highRiskCheckboxValidator); // checkbox click event handler | |
}, 10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment