peterbe Member
|
posted July 28, 2000 05:55 AM
I want that - when people tick a checkbox for Delete in a form - that a confirm screen pops up to verify their choice. I begin by testing with confirm() and if it's 'true' then check the box they chose. If not true, then uncheck the box they chose.How do you UNcheck a checkbox box? Code:
code:
<script language="JavaScript"> <!-- function Delmsg(productID,product_description,fieldname) { var msg; msg = "---------------------------------------- Caution message --------------------------------------------\n\n\n"; msg += "Are you sure you want to delete this one?\n\nproductID:\t\t "; msg += productID; msg += "\nproduct_description:\t"; msg += product_description; msg += "\n\n\n---------------------------------------- Caution message -------------------------------------------\n"; if (confirm(msg)) { document.change_product.fieldname.checked; } else { !document.change_product.fieldname.checked; } //alert(msg); } --> </script>
Call:
code:
<input type=checkbox name=delete_0 value="500NO" onClick="javascript elmsg('500NO','Single Computer, 500K','delete_0')">
------------------
¬ peterbe.com ¬ |