473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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_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
3 18724
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) {...
1
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset...
7
by: Kermit Piper | last post by:
Hello, How can you clear session variables when a reset button is pressed? I thought I might be able to do something like: <% If request.form("Reset") = "Reset" then Session("variable") =...
16
by: sreemati | last post by:
Hi everyone, This is the scenario: I have two button - Submit and Reset Submit is used for validation and after validation is passed it passes it to another form to enter into database. ...
4
by: tomb | last post by:
Hi, can someone make sense of this? I am using AJAX to populate a <div>, which is working very nicely, except for one thing: My reset button in the resulting <formis dead. When I put a...
11
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field...
16
by: Giovanni D'Ascola | last post by:
Hi. I noticed that <input type="reset"actually don't enable checkbutton which are checked by default after they have been disabled by javascript. It's a bug?
1
by: anthriksh200 | last post by:
Hello, I have perl -cgi script in which we have used the javascript . In this the " resret" button is there which should reset the form defaut values (interms of drop down and then reload the ...
2
by: helplakshmi | last post by:
Hi All, I am new to php. The form that i am designing has few input input fields with submit and reset button. The functionality of submit and reset are working properly till now. My form ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.