#1
  1. John from Belfast
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Belfast, Northern Ireland
    Posts
    63
    Rep Power
    13

    Permission denied: 'MsgBox'


    I want to create an onClick event that displays the user with a prompt to let them know that they're leaving a secure site. The prompy will have a Yes/No option. The error says:

    "Permission denied: 'MsgBox'"

    Below is my code:

    Code:
    Dim warning
    warning = MsgBox("You will be leaving the secure site." & Chr(13) & Chr(10) & "Continue anyway?",4, "WARNING!!!")
    
    <a href="http://www.bma.org.uk/ap.nsf/Content/accesshealthrecords" target="_blank" onClick="<% Response.Write(warning) %>">http://www.bma.org.uk/ap.nsf/Content/accesshealthrecords</a>
    Any one know how to fix this?

    John
    ___________________
    Come visit my webpage - http://www.mclernon.com
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,508
    Rep Power
    4541
    Your code is trying to do a msgbox on the server, is that what you intended?
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  4. #3
  5. Inherits Programmer.Slacker
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Location
    Between my Id and your Ego
    Posts
    2,351
    Rep Power
    0
    John - you can't raise messageboxes from the server to the client (at least not in this way). You can express script to the client, but not call messagebox.
  6. #4
  7. John from Belfast
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Belfast, Northern Ireland
    Posts
    63
    Rep Power
    13
    Right, didn't know thats what I was doing. Is there a way to do it on the client side? Javascript possibly?

    John
    ___________________
    Come visit my webpage - http://www.mclernon.com
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,879
    Rep Power
    21
    Use a Confirm box
    http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp?ID=AW

IMN logo majestic logo threadwatch logo seochat tools logo