473,785 Members | 2,843 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 4516
Jim Ley wrote:
onsubmit is an event, there almost certainly some javascript capable
UAs that have no onsubmit event, although that's probably very rare
So if there's no onSubmit event, then a script attached to that event
will never fire. But relying on js for form submission seems crazy
anyways. I tried S. Poley's idea of quick client-side data validation
tied to onChange and onSubmit; the script returns false if something is
wrong. But I don't see any danger in this approach, so long as
validation is also done server-side as necessary.
what I certainly use often is a script which submits a form without
firing onsubmit,
How do you do that?
because client-side scripts are so bad.
Processing scripts?
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.
Hmm. The validation script does use RegExp. So what happens with a
script that validates using RegExp in a client that has onSubmit and no
RegExp? I'd better think about that.
In this particular case? Or are you saying that NOSCRIPT should
never be used?


I've never seen a case!


banal example: using js write() to write a mailto: email address, and
NOSCRIPT to write that address as plain text.
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.
That's good general advice.
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>


Good example. But you need, then, to add the "snazzy features" via js
without replacing it. If you replace it, something could still go wrong,
e.g., the client removes "something" but fails to put "something with
snazzy features" in its place.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #61
On Sat, 08 May 2004 08:44:50 -0400, Brian
<us*****@juliet remblay.com.inv alid> wrote:
Jim Ley wrote:
In this particular case? Or are you saying that NOSCRIPT should
never be used?


I've never seen a case!


banal example: using js write() to write a mailto: email address, and
NOSCRIPT to write that address as plain text.


So you believe document.write exists so you can do that safely - those
people who don't have document.write (and document is in no standard
so can you really expect it to be?) don't get anything, the
appropriate way - if there was any point doing it would be to write it
plain text then use DOM methods to change it into a mailto.

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

Jul 20 '05 #62
Jim Ley wrote:
Brian wrote:
banal example: using js write() to write a mailto: email address,
and NOSCRIPT to write that address as plain text.
So you believe document.write exists so you can do that safely -
those people who don't have document.write


Well, I *used* to believe that. ;-)
(and document is in no standard so can you really expect it to be?)
Did I mention that I'm not all that familiar with js? (No, that is not
an excuse. I should learn more about it before using it.)
the appropriate way - if there was any point doing it
There is much debate about munging addresses. I've reluctantly decided
to mung because the spam gets overwhelming, and because it annoys me
perhaps more than it should.
write it plain text then use DOM methods to change it into a mailto.


Thanks for suggestion. I didn't know that such a thing was even
possible. It might be a bit out of my league, but I can start learning
about DOM methods and changing nodes.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #63
Gertjan Klein <gk****@xs4all. nl> writes:
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.


However, with just one single-line text input, they will not send any
value specified for a named submit button. Thus pressing Enter and
activating the submit button aren't exactly the same.
Jul 20 '05 #64
Bruce Lewis wrote:
with just one single-line text input, they will not send any
value specified for a named submit button. Thus pressing Enter and
activating the submit button aren't exactly the same.


Google does no appear to work that way. I type text in the only input of
their search form and press my <enter> key. The result is a get request
identical to one caused by pressing the "Google Search" button with a
mouse or the keyboard.

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #65
Jim Ley wrote:
"Alan J. Flavell" wrote:
snip>
If you use NOSCRIPT in your pages, you're not taking enough care
with your script. NOSCRIPT should not be used.


Sounds like a topic that calls for being covered in your FAQ, no?


I no longer edit it, I'll try and encourage the current
editor in that direction though.


You will encourage me more effectively with e-mail than relying on me to
have time to catch up with the HTML groups. :)

But consider me encouraged as I share your opinion and don't consider
NOSCRIPT tags at all useful. They just don't represent the correct
relationship to be applicable to the problem.

Richard.
Jul 20 '05 #66

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
1859
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
9645
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
9480
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
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
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
8974
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
7500
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
5381
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...
1
4053
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
2
3650
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.