SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Message Boxs ?

  1. #1
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Message Boxs ?

    I am a new ASP user working on a university project. The design plan calls for the use of message boxs to confirm deletions from the DB. I have seen client side message boxs, but the design plan calls for server side pop ups using ASP. Can anyone show me how this is done.

    Thanks

  2. #2
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well that depends.
    You can write the code server side or client side but ultimately the output is ALL client side.

  3. #3
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I would do something like:

    put this in your <head>:

    Code:
    <script language='javascript'>
    <!--
    function deleteIt(loc)
    {
        if(confirm("are you sure you want to delete this record?"))
        {
            window.location.href=loc;
        }
    }
    // -->
    </script>
    And then you can use it this way:

    [vbs]
    response.write "<a href=""javascript:deleteIt('removetransact.asp?id=" & rec("id") & "');""><img src=""images/delete.jpg"" border=""0""></a>" & Chr(10)
    [/vbs]

    This is the exact code we use, and it works relatively well. Essentially if the client says "delete" they are prompted about whether they are sure. If they say yes, it goes to the removetransact.asp page and removes the record.

    Is this what you want?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  4. #4
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that will do the job.

    Thanks


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
  •