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

Home Posts Topics Members FAQ

Forms Retaining Data

A question came up at work from one of our clients about forms on their
site.

The data from these forms are processed by a PHP script and if all goes
well, a thank you screen appears. Sometimes, when you go back to the form
(by clicking the back button), the data is still there in the form fields.
Other times it is not. The client would like to ensure the data remains, as
they sometimes have multiple submissions to make with similar entries.

There is client-side validation (JavaScript) on the forms, but other than
that, nothing else special about them.

Is there a way to ensure the values in the fields remain on return, or is
this just a quirk in browsers? The most commonly used browsers are IE & NN.

I would include a link to the form in question, but it is a request form for
a gubernatorial service (sent directly to the Gov's office), and I'd hate to
see them receive bogus requests.
Thanks.

--
SamMan
Rip it to reply

Jul 20 '05
65 4518
"SamMan" <sa*@psfdevri p-it.com> wrote in message news:<P2******* *******@twister .rdc-kc.rr.com>...
"Michael Wilcox" <mj************ @yahoo.com> wrote in message
news:c6******** ****@ID-230276.news.uni-berlin.de...
SamMan wrote:
Does this mean that if I have my JS off, I can't submit your form?


Yes... and only because I have coded it so. Without the code I wrote, if the
user has JS disabled, the submit button still functions.


People who purposely make forms fail to function with JavaScript
disabled, which would otherwise be pefectly usable, deserve to be
taken to the village square and publicly whipped.

--
Dan
Dan's Web Tips: http://webtips.dan.info/
Jul 20 '05 #51
On Sun, 2 May 2004 13:16:11 +0100, "Alan J. Flavell"
<fl*****@ph.gla .ac.uk> wrote:
On Sun, 2 May 2004, Gertjan Klein wrote:
Submit buttons function as "default button",
Sorry, I don't understand what you're trying to say.


I was trying to say that pressing the Enter key activates the submit
button, even if it doesn't have focus. This is different from the Enter
key submitting the form directly.

The reason for my remark was to indicate why the form would *not* submit
if the submit button was disabled.
Maybe you're
describing the user interface conventions in one particular browser
implementation , but I'm sure that this is not a property of the WWW
specificatio ns in themselves.
I don't know if it's formally specified anywhere, but it works like that
in more than one browser. I found the HTML 4.01 spec rather vague about
*how* a submit button is "activated" .
In the terms of the HTML2.0 specification (RFC1866),
http://www.w3.org/MarkUp/html-spec/h..._8.html#SEC8.2 (second
paragraph), it's not even essential for such a form to *have* any
submit button (I'm not actually recommending that, but it would at
least be logically consistent).


True, and I was unaware of this. However, the paragraph you refer to
starts with: "When there is only one single-line text input field in a
form". I must admit that I find this a bit ambiguous. Does this mean to
describe the situation where a form contains only a single-line text
input, or can it contain other inputs (but no other single-line text
inputs)?

At least on Mozilla 1.6, Opera 7.23, and IE 6, *if* a submit button is
present, besides one single-line text input, disabling the submit button
disables the described functionality - i.e., pressing Enter no longer
submits the form. This suggests to me that at least their interpretation
is consistent with what I wrote.

But you are right, I described behaviour of specific implementations ,
and e.g. Konqueror 3.1.3 *does* submit the form described in the
previous paragraph.

Gertjan.

--
Gertjan Klein <gk****@xs4all. nl>
Jul 20 '05 #52
"D. Stussy" <kd****@bde-arc.ampr.org> wrote:

Please trim your quoting to the bare minimum.

--
Spartanicus
Jul 20 '05 #53
In article <aa************ **************@ posting.google. com>,
da*@tobias.name (Daniel R. Tobias) wrote:
People who purposely make forms fail to function with JavaScript
disabled, which would otherwise be pefectly usable, deserve to be
taken to the village square and publicly whipped.


Or thrown from the castle's bridge.

--
Kris
<kr*******@xs4a ll.netherlands> (nl)
<http://www.cinnamon.nl/>
Jul 20 '05 #54
Jim Ley wrote:
On Sun, 02 May 2004, "D. Stussy" wrote:
If JS is disabled, so is his submit button.
JS available is not a black and white thing, you can have script
enabled but no onsubmit/onclick event for example.


Being a novice in js, I'm afraid I don't quite grasp this. On a general
level, it seems plausible, but could you explain have a js enabled
browser but no onsubmit event? Surely you mean on the client end?
If you use NOSCRIPT in your pages, you're not taking enough care with
your script. NOSCRIPT should not be used.


In this particular case? Or are you saying that NOSCRIPT should never be
used?

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #55
Jim Ley wrote:
On Sun, 02 May 2004 06:57:42 GMT, "D. Stussy"
<kd****@bde-arc.ampr.org> wrote:

I'm convinced that you also said the opposite. But no matter: your
server-side script can get invoked by anyone with a mind to do it, no
matter how hard you try to stop it in your HTML.


He said something different but not necessarily opposite. He could have his
submit button code between <script> tags and not offer it in the <noscript>
alternative , or offer one with a "disabled" control in the <input> tag.
However, he was clear: If JS is disabled, so is his submit button.

JS available is not a black and white thing, you can have script
enabled but no onsubmit/onclick event for example.
If you use NOSCRIPT in your pages, you're not taking enough care with
your script. NOSCRIPT should not be used.


What about those using browers that either don't support javascript or
have it disabled?

= Eric

Jul 20 '05 #56
On Mon, 3 May 2004, Gertjan Klein wrote:
The reason for my remark was to indicate why the form would *not* submit
if the submit button was disabled.
Interesting, thanks. Yes, I can see evidence of the behaviour that
you're describing, in various browsers. I must admit this was not an
area that I had specifically explored before.
I don't know if it's formally specified anywhere, but it works like that
in more than one browser. I found the HTML 4.01 spec rather vague about
*how* a submit button is "activated" .
Indeed, and there have been a number of arguments about whether
_any_ "submit" control can be counted as a "successful control"
(in the terms of
http://www.w3.org/TR/html401/interac...ssful-controls )
when the form is submitted without using any of them (e.g by hitting
Enter).
In the terms of the HTML2.0 specification (RFC1866),
http://www.w3.org/MarkUp/html-spec/h..._8.html#SEC8.2 (second
paragraph), it's not even essential for such a form to *have* any
submit button (I'm not actually recommending that, but it would at
least be logically consistent).


True, and I was unaware of this. However, the paragraph you refer to
starts with: "When there is only one single-line text input field in a
form". I must admit that I find this a bit ambiguous. Does this mean to
describe the situation where a form contains only a single-line text
input, or can it contain other inputs (but no other single-line text
inputs)?


Here's an answer to that question which I prepared earlier ;-)
http://ppewww.ph.gla.ac.uk/~flavell/...mquestion.html
At least on Mozilla 1.6, Opera 7.23, and IE 6, *if* a submit button is
present, besides one single-line text input, disabling the submit button
disables the described functionality - i.e., pressing Enter no longer
submits the form. This suggests to me that at least their interpretation
is consistent with what I wrote.


OK, thanks for responding to this point. I've learned something. As
it says, I deliberately excluded discussion of scripting from that
page of mine; and DISABLED is an attribute which only makes any kind
of practical sense when scripting is in use. So I hadn't explored
those issues before.

All the best
Jul 20 '05 #57

"Jim Ley" <ji*@jibbering. com> wrote in message
news:40******** *******@news.in dividual.net...
On Sun, 02 May 2004 06:57:42 GMT, "D. Stussy"
<kd****@bde-arc.ampr.org> wrote:
I'm convinced that you also said the opposite. But no matter: your
server-side script can get invoked by anyone with a mind to do it, no
matter how hard you try to stop it in your HTML.


He said something different but not necessarily opposite. He could have hissubmit button code between <script> tags and not offer it in the <noscript>alternative, or offer one with a "disabled" control in the <input> tag.
However, he was clear: If JS is disabled, so is his submit button.


JS available is not a black and white thing, you can have script
enabled but no onsubmit/onclick event for example.
If you use NOSCRIPT in your pages, you're not taking enough care with
your script. NOSCRIPT should not be used.


What does the care you take with your script have to do with the
advisability of providing an alternative for people who aren't executing
your script?

Jul 20 '05 #58
On Mon, 03 May 2004 21:16:54 -0400, Brian
<us*****@juliet remblay.com.inv alid> wrote:
Jim Ley wrote:
On Sun, 02 May 2004, "D. Stussy" wrote:
If JS is disabled, so is his submit button.


JS available is not a black and white thing, you can have script
enabled but no onsubmit/onclick event for example.


Being a novice in js, I'm afraid I don't quite grasp this. On a general
level, it seems plausible, but could you explain have a js enabled
browser but no onsubmit event? Surely you mean on the client end?


of course on the client, but onsubmit is an event, there almost
certainly some javascript capable UAs that have no onsubmit event,
although that's probably very rare, what I certainly use often is a
script which submits a form without firing onsubmit, because
client-side scripts are so bad. The larger problem though is in what
happens when there's an error in your validation code, this is very
common - using RegExp's in a non-RegExp capable client for example.
So you always need to protect against what happens when any part of
your script isn't available or errors or whatever.
If you use NOSCRIPT in your pages, you're not taking enough care with
your script. NOSCRIPT should not be used.


In this particular case? Or are you saying that NOSCRIPT should never be
used?


I've never seen a case! Your script will error in a browser, or it
won't do what you expect, there's no escaping this fact, and in those
circumstances you need to ensure that your page still works - if your
"no javascript" fallback is hidden from the user inside a NOSCRIPT it
won't help on jot. What you need to do is have the javascript only
ADD functionality to a page, so you should never need a NOSCRIPT to be
the functional equivalent of a piece of script, just leave the basic
page there.

So for example, instead of:

<script type="text/ecmascript">
document.write( "something with snazzy features");
</script>
<noscript>
something
</noscript>

do

something
<script type="text/ecmascript">
if (variousObjectT ests() ) {
// Use some script to add to something, or replace
// something or whatever is appropriate
}
</script>

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #59
On Tue, 4 May 2004 10:30:34 -0400, "Harlan Messinger"
<h.*********@co mcast.net> wrote:
If you use NOSCRIPT in your pages, you're not taking enough care with
your script. NOSCRIPT should not be used.


What does the care you take with your script have to do with the
advisability of providing an alternative for people who aren't executing
your script?


Because you cannot take sufficient care, therefore don't bother,
redesign your script so that it only adds functionality so there is no
equivalent needed.

You will not be able to take enough care, any real world script you
show me, I'll give you a way it can fail, with most I'll probably be
able to find a UA where it actually fails, rather than just a
theoretical. Scripts fail, you can't do anything about it, it's all
about controlling the ways they fail :-)

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #60

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

Similar topics

1
2053
by: Vanessa | last post by:
Hi all ! I am looking for a php class and page layout framework allowing smooth object oriented insertion of several, possibly different, forms within the same page layout. All of that while retaining the very desirable properties of a great php class : - self contained - auto validation
1
12228
by: noor | last post by:
Hi I have been working since 2 days to device a method to export sql table into csv format. I have tried using bcp with format option to keep the column names but I'm unable to transfer the file with column names. and also I'm having problems on columns having decimal data. Can any one suggest me how to automate data transfer(by using SP) and retaining column names. Thanks Noor
9
1739
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to functional and speed reasons (this app. will be deployed to a PocketPC) I want to merely Hide() each form when the user is finished with it, rather than allow it to Close(). In this way the user can "back" button their way back to each previous form...
4
5645
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no SSL no forms auth. One of the subfolders in the public area is the root of a "protected" area; SSL is required from this subfolder on forward and a web.config in the subfolder specifies forms authentication. From the public area, I provide a...
3
1410
by: Rob | last post by:
I am doing something wrong in declaring variables for forms I want to load. When the declaration is read, the form closes. I have a form, Form1, that loads at startup. After the Windows-generated code for Form1, there are a few declarations: Public Shared frm2 As New Form2, Public Shared frm3 As New Form3, etc., for five different forms called from Form1. I've just added a new form to the application, Form6, and declared it as...
5
11903
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My dropdown list control does not retain its SelectedValue. Unless I read the SelectedValue right after the control has been loaded, populated, and assigned with its original value (and of course that is
5
1812
by: David Cartwright | last post by:
Hi all, I'm using a DataGrid to present a tabulated list (actually a list of users logged in to my phone system) - it seemed the most appropriate control. As stuff happens on the phone system, my program changes the colours of various lines - so if someone's on the phone their line would turn red, when they hang up it turns green, and so on. The thing is, though, when you re-order the grid elements by clicking on the column headers,...
4
2237
by: RoMo | last post by:
I am using VB .NET (2003) for a project that includes a datagrid on one form that allows the user to switch to details on a second form. The datagrid was built in design mode with all the proper style information. The user types in a part of a company name and a database search returns matching data (via ADO) to a dataset. If more than 1 matching company was found, the datagrid is made visible and has its source and member assigned to the...
2
1860
by: s4lin | last post by:
problem is pagination not retaining data field i have form with general data field, and i need to select some option which is store in database, so i open another page with retrieving data from table with pagination form data's are retaining if i select from first page but data not retaining if i select option from other than 1st page. i m using hidden field in pagination page. Thanks stalin
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9525
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
10003
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
9050
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
7546
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
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.