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

Thread: reset form

  1. #1
    Regular Coder
    Join Date
    Sep 2010
    Posts
    122
    Thanks
    6
    Thanked 0 Times in 0 Posts

    reset form

    <script type="text/javascript">


    function resetForm()
    {
    //noofrow = document.getElementById("NoOfRow").value;
    //form = document.getElementByID('form1');
    //noofrow.reset();
    d1=document.getElementById("textfield").value;
    d1="";
    d1.reset();
    return false;
    }



    </script>

    </head>

    <body>
    <form id="form1" name="form1" method="post" action="">
    <p>
    <label>
    <input type="text" name="textfield" id="textfield" />
    </label>
    </p>
    <p>
    <label>
    <input type="text" name="textfield2" id="textfield2" />
    </label>
    </p>
    <p>
    <label>
    <input type="text" name="textfield3" id="textfield3" />
    </label>
    </p>
    <p>
    <label>
    <input type="Submit" name="button" id="button" value="Submit" onclick="resetForm()" />
    </label>
    </p>
    <p>&nbsp;</p>
    </form>

    how do i reset first input box ..............other data should be remain as follows................


    plz help me to do this

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,858
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    <input type="Submit" name="button" id="button" value="Reset" onclick="document.getElementById('textfield').value='';" />
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Sep 2010
    Posts
    122
    Thanks
    6
    Thanked 0 Times in 0 Posts
    [QUOTE=abduraooft;1017513]
    Code:
    <input type="Submit" name="button" id="button" value="Reset" onclick="document.getElementById('textfield').value='';" />
    [/QUOTE

    thankz for the reply still resetting all the fields .

    still not solved the problem

    plz help me to do this.

  • #4
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    Code:
    <input type="button" value="Reset" onclick="document.getElementById('textfield').value='';" />


  •  

    Posting Permissions

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