Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Location
    Sunny Southern California
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is it possible to have an "Undo" with a form reset?

    I have a simple score calculator and I was just curious to know if there was a way to be able to undo the reset option. (I think that is how I want to put it.)
    Meaning, you put in all scores and got final total, then hit reset and went "oops I forgot what my score was". You could click undo and have your scores back.
    Sorry, if I am not making any sense I am very new to all of this. You can see what I am talking about here http://dobbers.offline.org/scorecard
    http://dobbers.offline.org/scorecard3
    There are two different ones, but they both do the same thing.
    If it is not possible, then that is fine. I will just have to put in a little note about making sure everything is correct before hitting reset. Thank you in advance for your time/help/effort. I truly appreciate these forums!
    (I hope posting the links is ok, instead of the actual script.)
    Yesterday is history - Tomorrow is a mystery - Today is a gift!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Code:
    <input type="reset" onclick="return confirm('Do you really want to reset? All the values will be lost.')" value=" Reset " />
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New to the CF scene
    Join Date
    Jul 2005
    Location
    Sunny Southern California
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I will take that as a NO. Thank you for your help. I have added that line.
    Yesterday is history - Tomorrow is a mystery - Today is a gift!

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    It's possible but it would be easier to just implement the confirmation message.
    But if you still want to have an Undo button even with the confirmation message, all you need to do is store the entered values of the fields before the reset is done. Then when Undo is clicked, retrieve those values and then sets them to their corresponding fields.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •