...

View Full Version : delete confirmation alert



joonstar
08-26-2004, 10:19 PM
I have a delete button which is linked to delete_action page.

So if a user click the delete button, it will go to delete_action page.

I like to make an alert which conforms "delete or not" before it will go to delete_action page.


The confirmation alert, for example, will say " will you delete? " and have the two option buttons "Yes" and "no."


Can make the confirmation alert with your javascript help?


You can see what I am trying to do at http://220.89.242.19:8500/test/011/home/read.cfm?ID=1.

Willy Duitt
08-26-2004, 10:44 PM
Try javascript confirm().....

joonstar
08-26-2004, 10:48 PM
Try javascript confirm().....

How can I write the javascript confirm?

Willy Duitt
08-26-2004, 10:53 PM
How can I write the javascript confirm?

A search of this forum would return many examples or you could try Google: Keywords: javascript confirm (http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=javascript+confirm)....

joonstar
08-26-2004, 11:22 PM
you could try Google: Keywords: javascript confirm (http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=javascript+confirm)....

I think I found the right page( http://webreference.com/programming/javascript/confirm/2.html ). Thank you

jamescover
08-26-2004, 11:29 PM
<script type="text/javascript">
<!--

function chkFrm(){

var doc = document['oFrm'];
var subConf = confirm ("DELETE?!?!" + "\r\n\r\n" + "Click \"OK\" to delete," + "\r\n\r\n" + "or \"Cancel\" to return.");

if (subConf == true){
doc.submit();

} else if (subConf == false){
return false;
}
}

//-->
</script>


<form name="oFrm" method="post" action="delete.php">
<input type="button" value="submit" onclick="javascript:chkFrm();" />
</form>


-james

joonstar
08-27-2004, 12:38 AM
Thank you, jamescover.

Your code works fine.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum