473,398 Members | 2,188 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,398 software developers and data experts.

Clear Button malfunction on HTML form generated by PHP

I have a HTML form that is generated in part by PHP. The action
attribute on the form tag calls itself, so that I can validate the
fields without using any other form of code like Javascript to
validate fields, etc.

All works well; fields like e-mail addresses are correctly validated
with one notable exception.

The <input type="reset" ... only works the first time the form is
called.

If there are any problems with the fields, causing the form to refresh
with advisory data, then the Clear button does not function.

I am unable to explain this. Has anyone spotted anything similar? Do
you know why? Is there a workaround?

Many thanks.

John
Dec 11 '07 #1
1 2261
On Tue, 11 Dec 2007 14:32:31 +0100, <jo********@gmail.comwrote:
I have a HTML form that is generated in part by PHP. The action
attribute on the form tag calls itself, so that I can validate the
fields without using any other form of code like Javascript to
validate fields, etc.

All works well; fields like e-mail addresses are correctly validated
with one notable exception.

The <input type="reset" ... only works the first time the form is
called.

If there are any problems with the fields, causing the form to refresh
with advisory data, then the Clear button does not function.

I am unable to explain this. Has anyone spotted anything similar? Do
you know why? Is there a workaround?
<input type="reset"doesn _not_ empty all the values, rather it resets
all form values to the one in the HTMl source.
<http://www.w3.org/TR/html4/interact/forms.html#reset-button>

So if you're kind enough to provide them with the previous values so
they'll only have to change the incorrect one, those will be set. If you
want a 'clear' button instead of a 'reset' button, you'll either have to
use some javascript to do that, or make it a submit button and return a
crisp form to the user on that post value.
--
Rik Wasmus
Dec 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
i need to implement a clear button to clear all the fields in the form, but i am thinking i can just use reset button. <input type="reset" name="reset" value="CLEAR"> The first thought is...
3
by: Epetruk | last post by:
Hi, I'm trying to design a simple web form, but I cannot get the code in the btnSubmit_ServerClick event to fire. What am I doing wrong? Here's the codebehind: using System; using...
5
by: Girish | last post by:
I have TWO submit buttons of type IMAGE on my asp form. This renders as <input type="image">. I need to be able to eble the ENTER button for both buttons. Yes, I know that for the input type...
8
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
4
by: Eirik Eldorsen | last post by:
Is it possible to clear the generated html ouput on aspx page, and then write something else? Why? :-) I want to only the html code from a panel, and most important no form tags. Why? I'm...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
2
by: ShaneFowlkes | last post by:
I created a couple of quick test pages and to my surprise, these do not work either. When I click "Go Back" on test2.aspx, nothing happens. Ideas?? Surely I must be missing something obvious........
5
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...
0
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...

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.