|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
JavaScript confirm delete
Author: Adkins, Randy
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33214#166576
<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
_____
Author: Robert Orlini
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33214#166573
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: Greg Landers
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33214#166572
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:
----- Excess quoted text cut - see Original Post for more -----
Author: Katz, Dov B (IT)
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33214#166569
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: Mosh Teitelbaum
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:33214#166567
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
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||