By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

reset button not working

P: n/a
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_links.php' method='POST' name='save_links'
id='save_links'>

<table cellpadding='5'>

<caption align='top'>Edit 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.google.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.yahoo.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.kashifkhan.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.k12isys.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.kgamerworld.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'>&nbsp;</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

Jul 28 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
kashif_khan <ka************@gmail.comscripsit:
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")
http://www.cs.tut.fi/~jkorpela/

Jul 28 '06 #2

P: n/a

Jukka K. Korpela wrote:
kashif_khan <ka************@gmail.comscripsit:
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

Jul 28 '06 #3

P: n/a
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*?
Jul 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.