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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Brisbane, Australia
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Getting a confirmation box when you click a link

    Hi there

    having a bit of strife with javascript. What I've got is a file to delete records from my DB using php. What i need is a bit of javascript code to put within the link to bring up a confirmation box so I dont accidentally delete a record i still need or something.

    what would I put in the onClick=.... part of the link? i can't seem to get it to work. I need to get it to confirm on the page the link's on, because as soon as you get to delete.php it will delete the record anyway.

    Can anyone help?

    thanks heaps!

    Lachlan.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    New York, USA
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try this:
    <a href="----" onclick="return (confirm('are you sure?'))?true:false;">link</a>


  •  

    Posting Permissions

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