SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Location
    Ireland!
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Are you sure you want to press this button?"

    Hi,

    Total js noob question. I have a reset button on a form. I want javascript to ask throw up a pop up when if the user clicks the reset button which states "Do you wish to reset the form?". There should be an "OK" and "Cancel" button. If the user presses "OK" then the action will occur. If the user presses "Cancel" then the action will NOT occur.

    I know this is just a simple piece of script but I am not a JS programmer.

    Thanks.

    hj

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <input type="reset" value="Reset Form" onclick="return confirm('really really?');">
    that should do it.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Location
    Ireland!
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks man.

    hj


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
  •