House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search cf-talk

August 21, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

JavaScript confirm delete

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Robert:
Mosh Teitelbaum
06/14/04 03:34 P
Why not just say
Katz, Dov B (IT)
06/14/04 03:37 P
Done. Thanks all.
Robert Orlini
06/14/04 03:53 P
<script language="JavaScript">
Adkins, Randy
06/14/04 04:01 P

06/14/2004 03:34 PM
Author:
Mosh Teitelbaum

Robert: Something like the following should do it for you.  The confirm() function in JavaScript creates a dialog box with "OK" and "Cancel" buttons.  Pressing "OK" returns true, pressing "Cancel" returns false.   <SCRIPT LANGUAGE="JavaScript">   <!--     function confirmDelete() {       var msg = "Are you sure you want to delete?";       if ( confirm(msg) ) {         document.formName.submit();       }     }   // -->   </SCRIPT>   <FORM NAME="formName" ACTION="delete.cfm" METHOD="Post">     <INPUT TYPE="Button" VALUE="Delete" onClick="confirmDelete();">   </FORM> Note, this was just whipped together and not tested.  Also, the above form is incomplete.  At the least, it should likely specify an ID of the object that is to be deleted, etc. ColdFusion can do this too but it requires an extra trip to the server, i.e.,   deleteForm.cfm -> deleteConfirm.cfm -> deleteAction.cfm -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: mosh.teitelbaum@evoch.com WWW: http://www.evoch.com/ Anyone have or know where I can get some JavaScript code that uses a JavaScript confirm box to ask the user if they want to delete? Is there a CF way to do it? Thanks. Robert O. at HWW

06/14/2004 03:37 PM
Author:
Katz, Dov B (IT)

Why not just say <Form blah action="xxxxxxx" onSubmit="return confirm('Are you sure you want to delete?');"> <etc> -Dov   _____   Sent: Monday, June 14, 2004 3:30 PM To: CF-Talk Subject: RE: JavaScript confirm delete Robert: Something like the following should do it for you.  The confirm() function in JavaScript creates a dialog box with "OK" and "Cancel" buttons. Pressing "OK" returns true, pressing "Cancel" returns false. <SCRIPT LANGUAGE="JavaScript"> <!-- function confirmDelete() { var msg = "Are you sure you want to delete?"; if ( confirm(msg) ) { document.formName.submit(); } } // --> </SCRIPT> <FORM NAME="formName" ACTION="delete.cfm" METHOD="Post"> <INPUT TYPE="Button" VALUE="Delete" onClick="confirmDelete();"> </FORM> Note, this was just whipped together and not tested.  Also, the above form is incomplete.  At the least, it should likely specify an ID of the object that is to be deleted, etc. ColdFusion can do this too but it requires an extra trip to the server, i.e., deleteForm.cfm -> deleteConfirm.cfm -> deleteAction.cfm -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: mosh.teitelbaum@evoch.com WWW: http://www.evoch.com/ Anyone have or know where I can get some JavaScript code that uses a JavaScript confirm box to ask the user if they want to delete? Is there a CF way to do it? Thanks. Robert O. at HWW   _____  

06/14/2004 03:51 PM
Author:
Greg Landers

you could also do this on an anchor tag ... which comes in handy sometimes: <a href="delete.cfm" onClick=""return confirm('Delete?!?');">Delete</a> - Greg Katz, Dov B (IT) wrote:

06/14/2004 03:53 PM
Author:
Robert Orlini

Done. Thanks all. Robert O. Why not just say <Form blah action="xxxxxxx" onSubmit="return confirm('Are you sure you want to delete?');"> <etc> -Dov   _____   Sent: Monday, June 14, 2004 3:30 PM To: CF-Talk Subject: RE: JavaScript confirm delete Robert: Something like the following should do it for you.  The confirm() function in JavaScript creates a dialog box with "OK" and "Cancel" buttons. Pressing "OK" returns true, pressing "Cancel" returns false. <SCRIPT LANGUAGE="JavaScript"> <!-- function confirmDelete() { var msg = "Are you sure you want to delete?"; if ( confirm(msg) ) { document.formName.submit(); } } // --> </SCRIPT> <FORM NAME="formName" ACTION="delete.cfm" METHOD="Post"> <INPUT TYPE="Button" VALUE="Delete" onClick="confirmDelete();"> </FORM> Note, this was just whipped together and not tested.  Also, the above form is incomplete.  At the least, it should likely specify an ID of the object that is to be deleted, etc. ColdFusion can do this too but it requires an extra trip to the server, i.e., deleteForm.cfm -> deleteConfirm.cfm -> deleteAction.cfm -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: mosh.teitelbaum@evoch.com WWW: http://www.evoch.com/ Anyone have or know where I can get some JavaScript code that uses a JavaScript confirm box to ask the user if they want to delete? Is there a CF way to do it? Thanks. Robert O. at HWW   _____   _____  

06/14/2004 04:01 PM
Author:
Adkins, Randy

<script language="JavaScript"> <!-- function confirmDelete(aURL) {     if(confirm('Are you sure you want to delete this BLAH BLAH BLAH?')) {       location.href = aURL;     }   } //--> </script> Anyone have or know where I can get some JavaScript code that uses a JavaScript confirm box to ask the user if they want to delete? Is there a CF way to do it? Thanks. Robert O. at HWW   _____  


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists