SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast roloenusa's Avatar
    Join Date
    Mar 2004
    Location
    Moorpark
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Alert confirmation before redirecting user

    Hey guys:

    I'm working in an .asp page where the user can delete a record. However i want an alert window to be displayed when the user clicks on delete asking the user if he really wants to or not ( the kind that has the two buttons ). If the user clicks no then the record delete is cancel, and if the user click yes then if goes to the page where it will be delete it.

    I don't know much about Java Script, and google didn't bring anything consistent up, so i was wondering if you could help me...

  2. #2
    There is no general chat z0s0's Avatar
    Join Date
    Aug 1998
    Location
    Melbourne
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add this

    onclick="return confirm('are you sure?');"

    To the <input type="submit" /> that you use on the form.

    It'll work on links, too, or you could do it with an onsubmit="" event in the <form /> element.
    Wormly Server Performance Monitoring
    Don't wait for an SMS at 4am. Find out what's really
    going on and fix the problem. www.wormly.com/website-monitoring


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
  •