Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alert, and then submit...

    Javascript is my weakness

    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!!
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    wiz...
    does thisss link just a help® ya???
    http://www.codeave.com/javascript/code.asp?u_log=7035

    just a goodluck® :O)))

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    if(confirm("Are you sure?")){
        // This code runs if the user clicks "OK"
    } else {
        // This code runs if the user clicks "Cancel"
    }

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    confirm boxes are IE only i believe ..... (?)

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #7
    New to the CF scene
    Join Date
    Jan 2003
    Location
    namibia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hai

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

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

    <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •