Refael
asked on
jquery check-boxes
Hello Experts,
I got the solution below from sonawanekiran (an experts-exchange expert :-)).
i changed it a bit but it does not seem to work anymore. I was doing testings but nothing get it to work. can you please help?
* there are two check-boxes to check ... if both are checked then print the note.
I got the solution below from sonawanekiran (an experts-exchange expert :-)).
i changed it a bit but it does not seem to work anymore. I was doing testings but nothing get it to work. can you please help?
* there are two check-boxes to check ... if both are checked then print the note.
$(document).ready(function() {
$(".checkboxes").click(function(){
check_if_checkboxes_checked();
});
});
function check_if_checkboxes_checked(){
var flag = true;
$(".checkboxes").each(function(){
if (!$(this).is(':checked'))
flag = false;
});
if (flag) {
$('#additionalNote').append('<span class="tbl_note">Please note: $10 will be added to the monthly payment.</span>');
}
else
$('#additionalNote span').remove();
}
ASKER
Hi leakim971,
no, it does not work.
i guess the above replace my script, right? and this code above should be in the "$(document).ready(functio
it only replace the second part, the check_if_checkboxes_checke d function
ASKER
leakim971,
first there is an error ( i have to remove the last '}' to get rid of the error.
second it does not work. here is the entire script.
$(document).ready(function() {
$(".checkboxes").click(function(){
check_if_checkboxes_checked();
});
});
function check_if_checkboxes_checked(){
if($(".checkboxes:checked").length < 2)
$('#additionalNote').append('<span class="tbl_note">Please note: $10 will be added to the monthly payment.</span>');
return true;
}
$('#additionalNote span').remove()
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Guys. i am so so so sorry!
the problem was a misspelling of the class name 'checkboxs" instead of "checkboxes"... how duff am i?
i am sorry i was bothering you..... thanks. both of the solution works just fine!!!
ASKER
read my comment. thank you so much guys!
if($(".checkboxes:checked"
$('#additionalNote').appen
return true;
}
$('#additionalNote span').remove();
}