reset textboxes in previous values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deep4ut
    New Member
    • Dec 2011
    • 4

    #1

    reset textboxes in previous values

    I want javascript code in which ,,onclick on cancel button results, all form's textboxes will be reset in their previous values.? formname.reset( ) is not working ... :(
  • deep4ut
    New Member
    • Dec 2011
    • 4

    #2
    I got the answer
    Code:
    <script>
    function resetform()
    {
    document.getElementById("formname").reset();
    }
    </script>
    now just call this function onclick event of Cancel button
    Last edited by acoder; Dec 19 '11, 12:07 PM. Reason: Added [code] tags

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Why not just use a standard input reset button? Also consider the usability issues with reset buttons.

      Comment

      • deep4ut
        New Member
        • Dec 2011
        • 4

        #4
        no,,i am using
        <a href="#" class="negative " name="cancel" onclick="jacasc ript:reformset( );" >
        <img src="http://bytes.com/topic/javascript/images/cross.png" alt=""/>Cancel</a> Reset button is just button .here i am using image

        Comment

        Working...