Hello, I am trying to throw an alert from the onClick event of a radio button based on the "checked" state of a checkbox. I am testing with several dynamically created checkboxes, which start out empty but the user then clicks. If they don't click one, they should not be able to delete the record. Here's the function I've been working with. Any help would be greatly appreciated. Thanks in advance. Bob.
function deleteMessage()
{
var is_checked = window.document.form1.racknowledge.checked;
if (is_checked == true){
(confirm("This confirms that you have acknowledged this message. Are you SURE you want to delete this message?"
)
alert("Your message will be deleted."
;
document.form2.submit();
return true;
}else if (is_checked == false){
alert("You cannot delete a message if it has not been acknowledged!"
;
document.form2.reset();
return false;
}
}
function deleteMessage()
{
var is_checked = window.document.form1.racknowledge.checked;
if (is_checked == true){
(confirm("This confirms that you have acknowledged this message. Are you SURE you want to delete this message?"
alert("Your message will be deleted."
document.form2.submit();
return true;
}else if (is_checked == false){
alert("You cannot delete a message if it has not been acknowledged!"
document.form2.reset();
return false;
}
}