473,796 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 28 '06 #1
3 18749
kashif_khan <ka************ @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")
http://www.cs.tut.fi/~jkorpela/

Jul 28 '06 #2

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

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
30137
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) { $_SESSION = array(); } ?> <form enctype="multipart/form-data" name="company_info" method="post" action="add_pic.php">
1
14384
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 button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was clearing them and yet still leaving them working and visible if the user immediately began...
7
14643
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") = Null %>
16
16694
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. Bascially the reset works fine if I use it before using the submit button in the form. For instance,if on submit there is some error as the values have not passed a validation. There is a error pop up message shown and the values are retained in...
4
1886
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 breakpoint and trap the response in the javascript code, the returned html for the button looks like this: <input type=\"reset\" value=\"Clear\" />
11
7426
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 is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input type="text" id='IsChanged' value='0'>" Everything is working as expected (the value is reset to '0'...
16
2088
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
1666
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 fresh page. But this is wrking fine in mozil anot not in IE Here is the snippet of code <form name="feg_dist_request_form" method="post" action="$thisurl">
2
2783
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 <form name="search" id="search" action= "search.php" method = "post" onreset="formReset(this);return false;"> <table cellspacing="1" cellpadding="1" > <tr> <!-- Input field for responsible-->
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.