checkbox rules overlapping
I have 2 checkbox rules that are overlapping.
This one runs first
$("#BMFNP").change(function() {
if($(this).is(":checked") && $("#INTEF").is(":not(:checked)")) {
$("#INTEF").attr("checked", true);
alert("foo");
}
});
This one runs second:
$("#BMFNP").change(function() {
if($(this).is(":checked") && $("#INTEF").is(":checked")) {
alert("bar");
}
});
So basically the first one runs if BMFNP is checked, and INTEF isn't it checks INTEF and runs the alert. At that time, both are checked so it runs the second function. How can I fix this? I need both to work and display different messages for each situation, if BMFNP is checked, INTEF isn't check INTEF and alert it has been added and BMFNP can only do xxxxx. If both are checked, simply alert that BMFNP can only do xxxx, no need to alert it has been added.
Thanks,
Kane Leins