SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaScript/PHP Alert

    Say a user has a list of submitted stories, and he wants to delete one. He's viewing the list, and he clicks the DELETE button next to the desired submission. What would I need to do so that once the button (text link) is clicked, an javascript alert will be triggered, and if OK is clicked, the submission will be deleted, and if Cancel is clicked, the alert will close and nothing will happen.

    Thanks,

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a href="delete_story.php?story=3" onclick="if (confirm('Delete this story?'))document.form_name.submit();return false;">Delete Story</a>

    The href calls php for JS-disabled users (or asp, jsp, etc.).
    ::: certified wild guess :::


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
  •