SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,207
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    an alert staying there

    Code:
    <a href='delete.htm' 
    onclick="return alert('you are an invalid user')">Delete this entry</a>
    I have the code above.

    when a user clicks the link above, it pops an alert with the message "You are an invalid user."

    If the user clicks the confirm button on the alert, it will go to delete.htm.


    I like to make it like the following.

    If the user clicks the confirm button on the alert, it stays there instead of going to delete.htm

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <a href="delete.htm" onclick="return (!confirm('you are an invalid user'))">Delete this entry</a>

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2007
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or

    <a href="delete.htm" onclick="alert('you are an invalid user');return false">Delete this entry</a>

  4. #4
    Obey the Purebreed trib4lmaniac's Avatar
    Join Date
    Dec 2004
    Location
    Cornwall, UK
    Posts
    594
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This may be a little too obvious, but if the client has JavaScript disabled they will still be able to access your page. You will need some form of server-side access control as well.


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
  •