...

View Full Version : Alert, and then submit...



The Wizzard
01-22-2003, 12:40 AM
Javascript is my weakness :rolleyes:

Im creating a form thats connecting to my database, and will allow me to delete items from it. Currently, you click the item, and its gone. How can I make an alert popup when you click on it, and ask you if you're sure, then if you click "Ok" it deletes the item. If you click "No" nothing happens.

Thanks!!

justame
01-22-2003, 01:55 AM
wiz...
does thisss link just a help® ya???
http://www.codeave.com/javascript/code.asp?u_log=7035

just a goodluck® :O)))

Algorithm
01-22-2003, 02:03 AM
if(confirm("Are you sure?")){
// This code runs if the user clicks "OK"
} else {
// This code runs if the user clicks "Cancel"
}

cg9com
01-22-2003, 07:04 PM
confirm boxes are IE only i believe ..... (?)

The Wizzard
01-22-2003, 07:45 PM
Thanks!!

cg9com, its ok, because myself & one other person will only be able to use this, its in the admin backend, and we both use IE.

;)

Thanks again! :thumbsup:

whammy
01-23-2003, 12:03 AM
FYI, confirm boxes are NOT IE only... should work in everything, AFAIK, even work just fine in Netscape 4.78 (tested!), that's as far back as I go... ;)

Katrina
01-23-2003, 01:54 PM
hai :)

i thought may be you must use window.confirm() instead.

i found this, try it may be it will give you an idea:thumbsup:

<script>
var x=window.confirm("Are you sure you are you want to delete this?")
if (x)
window.alert("Good!")
else
window.alert("Too bad")
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum