August 21, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
JavaScript confirm delete
Robert:Mosh Teitelbaum 06/14/04 03:34 P Why not just sayKatz, Dov B (IT) 06/14/04 03:37 P you could also do this on an anchor tag ... which comes in handy sometimes:Greg Landers 06/14/04 03:51 P Done. Thanks all.Robert Orlini 06/14/04 03:53 P <script language="JavaScript">Adkins, Randy 06/14/04 04:01 P
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
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 _____
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:
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 _____ _____
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 _____
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||