I am having trouble with this statement and I was hoping I could get some help. Essentially, if edweek and edevenings (which are checkboxes) are not equal then I want to push to my array. The problem I am having is that I can get one of the values to be not equal, but when I add the second it doesn’t work.
function getEdVals() {
var edVals = [];
$('#edinitiativecont :checked').each(function() {
if($(this).val() == $("#liveweb").val()){
edVals.push($(this).val());
} else {
if($(this).val() == (!($("#edweek").val()) || $("#edevenings").val())){
edVals.push($(this).val());
}
}
});
}
Without seeing everything together, it is a bit difficult to ensure an accurate solution. The solution below condenses your current logic and corrects the else conditional statement.