dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Reset Form Button

  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Reset Form Button

    Hello, I have done a search form in HTML (with something in Javascript), and a reset button that works perfectly. The search results are published on the same page of search form, but once its searched the reset button no longer works. So, once the form is submited, reset button stops working ... someone knows how can I fix it?

    Thank you very much and best regards to all!

  2. #2
    Join Date
    Oct 2007
    Posts
    175
    Do you have a sample code you can post?

  3. #3
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114

    Resolved

    Here it is. I built a little search that uses Yahoo's email search. This resets.
    You can ignore everything but this line:
    <input value="Reset form" title="This will clear all data from the form" onclick="ClearForm()" type="reset">



    HTML Code:
    <form name="email" id="pple" action="http://search.yahoo.com/peopleredirect">	
    <table border="0" width="425">
      <tbody><tr>
    
        <td width="193"><label id="pplelastlbl" for="last">
        </label><div align="right"><strong>Last Name: </strong><span class="style4">(required)</span></div>
        </td>
        <td width="222"><input name="last" req="1" value="" type="text"></td>
      </tr>
      <tr>
        <td><label id="fnlbl" for="first">
        </label><div align="right">First Name/Initial:</div>
    
        </td>
        <td><input name="first" value="" type="text"><label id="pplelastlbl" for="last"></label></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input name="meta" value="pplt=e" type="hidden">
    <input value="Search" class="ygbt" type="submit">
    <input name="fr" value="php-emai" type="hidden">
    <input name="fr2" value="" type="hidden"></td>
      </tr>
    
      <tr>
      <td></td>
      <td>
      
        <input value="Reset form" title="This will clear all data from the form" onclick="ClearForm()" type="reset">
      
    </td>
      </tr>
    </tbody></table>
    </form>
    
    Last edited by donatello; 02-19-2009 at 03:58 PM.

  4. #4
    Join Date
    Oct 2007
    Posts
    175
    You have 2 options:

    <input value="Reset form" title="This will clear all data from the form" type="reset">

    <input value="Reset form" title="This will clear all data from the form" onclick="ClearForm()" type="button">

    Using onclick="ClearForm()" and type="reset" may be conflicting as they do the same thing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles