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 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Canada
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Reset Button issue.

    Changed my mind, I will try to do better in the future. Didn't mean to offend anyone.



    Here is the actual code that I have:

    <input class="formbutton" type="reset" value="Clear" onclick="if(confirm('Stop Timer?'))stopTimer();" name=Stop
    style="color:#ffddee;cursor:hand;border-color:red;"
    onmouseover="this.style.background='#990000'"
    onmouseout="this.style.background='#000000'">

    So, now... when I click on the button, it confirms to reset the timer. If I click cancel, it resets the form anyways. If I change the type to button, it doesn't clear the form at all. if I put in return false, still deletes the form if I click on the cancel button.

    Any suggestions would be appreciated
    Last edited by jrmevans; 12-19-2003 at 12:50 AM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I suggest you read our posting guidelines - particularly the bit about choosing an appropriate subject for your question.

    Yours was particuarly innapropriate, because not only did you not describe the problem, you used a cheap psychological tactic to try to get people to look at it, and that's not fair.

    So that's why I changed it.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Don't feel bad everyone messes up somtimes-

    You are trying to call other conditional events inside the reset that have nothing to do with whether or not it resets. Change it to a button and then if confirm = true have it click the reset button --> resetButtonId.click() (make the reset button have no display) along with what it is currently doing.

    Hope that helps,
    Basscyst
    Last edited by Basscyst; 12-19-2003 at 12:34 AM.
    Helping to build a bigger box. - Adam Matthews

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    <input class="formbutton" type="reset" value="Clear" onclick="if(confirm('Stop Timer?'))stopTimer();else return false;" name="Stop" ...>

    The return false on onclick event handler cancels the action of the "reset" button

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    Canada
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks that worked.


  •  

    Posting Permissions

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