|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><script language="JavaScript"> <!-- function Delmsg(productID,product_description,fieldname) { var msg; msg = "---------------------------------------- Caution message --------------------------------------------nnn"; msg += "Are you sure you want to delete this one?nnproductID:tt "; msg += productID; msg += "nproduct_description:t"; msg += product_description; msg += "nnn---------------------------------------- Caution message -------------------------------------------n"; if (confirm(msg)) { document.change_product.fieldname.checked; } else { !document.change_product.fieldname.checked; } //alert(msg); } --> </script>[/code] Call: <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><input type=checkbox name=delete_0 value="500NO" onClick="javascript elmsg('500NO','Single Computer, 500K','delete_0')">[/code]------------------ ¬ peterbe.com ¬ |
|
#2
|
|||
|
|||
|
Found it!
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <script> var box; box = eval("document.change_product."+fieldname); if (box.checked != true) { box.checked = false; } else { if (!confirm(msg)) { box.checked = false; } }</script> [/code] ------------------ ¬ peterbe.com ¬ |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Check and uncheck checkboxes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|