reset button not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kashif_khan

    reset button not working

    hi everyone,
    can anybody please tell me why reset button is not
    working in the following code, i tested it in opera, firefox and
    konqueror,

    <form action='edit_li nks.php' method='POST' name='save_link s'
    id='save_links' >

    <table cellpadding='5' >

    <caption align='top'>Edi t your Top website links</caption>

    <tr>

    <th width='12' align='center'> Rank</th>

    <th width='50' align='center'> Title</th>

    <th width='50' align='center'> Website Address</th>

    </tr>

    <tr>

    <td width='12' align='center'> 1</td>

    <td width='50' align='center'> <input type='text' id='title1'
    maxlength='300' size='40' value='Search the web'/</td>

    <td width='50' align='center'> <input type='text' id='link1'
    maxlength='300' size='40' value='www.goog le.com'/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 2</td>

    <td width='50' align='center'> <input type='text' id='title2'
    maxlength='300' size='40' value='mail and games'/</td>

    <td width='50' align='center'> <input type='text' id='link2'
    maxlength='300' size='40' value='www.yaho o.com'/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 3</td>

    <td width='50' align='center'> <input type='text' id='title3'
    maxlength='300' size='40' value='homepage '/</td>

    <td width='50' align='center'> <input type='text' id='link3'
    maxlength='300' size='40' value='www.kash ifkhan.net'/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 4</td>

    <td width='50' align='center'> <input type='text' id='title4'
    maxlength='300' size='40' value='Company website'/</td>

    <td width='50' align='center'> <input type='text' id='link4'
    maxlength='300' size='40' value='www.k12i sys.com'/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 5</td>

    <td width='50' align='center'> <input type='text' id='title5'
    maxlength='300' size='40' value='Company website'/</td>

    <td width='50' align='center'> <input type='text' id='link5'
    maxlength='300' size='40' value='www.kgam erworld.com'/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 6</td>

    <td width='50' align='center'> <input type='text' id='title6'
    maxlength='300' size='40' value=''/</td>

    <td width='50' align='center'> <input type='text' id='link6'
    maxlength='300' size='40' value=''/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 7</td>

    <td width='50' align='center'> <input type='text' id='title7'
    maxlength='300' size='40' value=''/</td>

    <td width='50' align='center'> <input type='text' id='link7'
    maxlength='300' size='40' value=''/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 8</td>

    <td width='50' align='center'> <input type='text' id='title8'
    maxlength='300' size='40' value=''/</td>

    <td width='50' align='center'> <input type='text' id='link8'
    maxlength='300' size='40' value=''/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 9</td>

    <td width='50' align='center'> <input type='text' id='title9'
    maxlength='300' size='40' value=''/</td>

    <td width='50' align='center'> <input type='text' id='link9'
    maxlength='300' size='40' value=''/</td>

    </tr>

    <tr>

    <td width='12' align='center'> 10</td>

    <td width='50' align='center'> <input type='text' id='title10'
    maxlength='300' size='40' value=''/</td>

    <td width='50' align='center'> <input type='text' id='link10'
    maxlength='300' size='40' value=''/</td>

    </tr>

    <br /<br />

    <tr>

    <td width='12' align='left'>&n bsp;</td>

    <td width='50' align='right'>< input type="submit" value="Save
    Changes" /></td>

    <td width='50' align='right'>< input type="reset" value="Clear All"
    /></td>

    </tr>

    </table>

    </form>

    sorry for the long listing, but i think it was neccessary.

    kashif khan

  • Jukka K. Korpela

    #2
    Re: reset button not working

    kashif_khan <kashifkhan1285 @gmail.comscrip sit:
    can anybody please tell me why reset button is not
    working in the following code,
    I'm rather sure it "works" for one value for "works", namely "acts according
    to HTML specifications" . The problem is probably that you expect it to do
    something else.
    <td width='50' align='right'>< input type="reset" value="Clear All"
    /></td>
    When the user presses the button, all text fields in the form are set to
    their initial (default) values as specified in the HTML code. I suspect that
    you expect it to set them all to empty values - but that's not what the
    specification says, and there is no way to do that in HTML.
    sorry for the long listing, but i think it was neccessary.
    It wasn't. You could and should have posted the URL of a demo page.

    P.S. A reset button almost never helps users but often hurts them. Don't use
    it except in the rare case where you expect users _typically_ submit several
    sets of data using the same form, and even then it's probably much better to
    make the form handler send back a response page that contains feedback about
    the submission (at least telling it was OK) and a fresh form for a new
    submission.

    --
    Jukka K. Korpela ("Yucca")


    Comment

    • kashif_khan

      #3
      Re: reset button not working


      Jukka K. Korpela wrote:
      kashif_khan <kashifkhan1285 @gmail.comscrip sit:
      >
      can anybody please tell me why reset button is not
      working in the following code,
      >
      I'm rather sure it "works" for one value for "works", namely "acts according
      to HTML specifications" . The problem is probably that you expect it to do
      something else.
      >
      <td width='50' align='right'>< input type="reset" value="Clear All"
      /></td>
      >
      When the user presses the button, all text fields in the form are set to
      their initial (default) values as specified in the HTML code. I suspect that
      you expect it to set them all to empty values - but that's not what the
      specification says, and there is no way to do that in HTML.
      Thanks a lot, I was expecting it to clear the the fields.It never
      crossed my mind that i was setting default values myself and it would
      only restore those default values.
      sorry for the long listing, but i think it was neccessary.
      >
      It wasn't. You could and should have posted the URL of a demo page.
      point noted. thanks again for the help.

      kashif khan

      Comment

      • Harlan Messinger

        #4
        Re: reset button not working

        kashif_khan wrote:
        hi everyone,
        can anybody please tell me why reset button is not
        working in the following code, i tested it in opera, firefox and
        konqueror,
        >
        I have a hint for you and for anyone else whoever asks for technical
        help with anything: "Why doesn't this work?" is an impossible question
        for anyone to answer, because it says absolutely nothing about what is
        happening or, often more importantly, how it compares with what you were
        expecting to have happen. If you call your mechanic and say, "Can you
        tell me why my car isn't working", would you expect him to have any idea
        *what* isn't working, let alone *why*?

        Comment

        Working...