SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Planet Earth
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    To delete or not delete...

    Hi there!

    I have a link to delete records from a db and it prompts a message asking to confirm or to cancel. But even If I choose cancel it deletes the record ??

    // Here is my link /////
    <a href="delete.php?id=<?php echo $row['id']; ?>"
    onclick="MM_popupMsg('Are you sure you want to delete this record?')">
    Delete </a>

    -- - - - - - - - - - - - - - - -

    /* This is the script////
    script type="text/JavaScript">
    <!--
    function MM_popupMsg(msg) { //v1.0
    return confirm(msg);
    }
    //-->
    </script>


    is there a way to stop all when clicking on Cancel?


    Thanxs for any help!
    "The Internet ? Is that thing still around ?"

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You're missing a return statement:

    Code:
    <a href="delete.php?id=<?php echo $row['id']; ?>" 
    onclick="return MM_popupMsg('Are you sure you want to delete this record?')">
    Delete </a>

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Planet Earth
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot stymiee! it works now correctly!
    "The Internet ? Is that thing still around ?"


Bookmarks

Posting Permissions

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