473,770 Members | 3,983 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 #1
65 4505
SamMan wrote:
The client would like to ensure the data remains, as
they sometimes have multiple submissions to make with similar entries.
This is a feature implemented in many browsers, but not all. You cannot
rely on it, since you cannot manipulate the user's browser. However, if
a problem is encountered and an error is found by checking it with PHP,
you should be able to reconstruct the form and fill in the values, all
using PHP. The user shouldn't have to depend on a feature his/her
browser might not have.
There is client-side validation (JavaScript) on the forms, but other than
that, nothing else special about them.


JS validation is ok, but most defiantly should not be relied on.
--
Michael Wilcox, http://mikewilcox.t35.com/
Jul 20 '05 #2
On Fri, 30 Apr 2004, Michael Wilcox wrote:
This is a feature implemented in many browsers, but not all. You cannot
rely on it, since you cannot manipulate the user's browser.
right...
However, if a problem is encountered and an error is found by
checking it with PHP, you should be able to reconstruct the form and
fill in the values, all using PHP. The user shouldn't have to depend
on a feature his/her browser might not have.


Good answer. The same is true for other server-side scripting, though
- it's not limited to PHP: for example the CGI.pm module makes this
quite straightforward in Perl with CGI.
There is client-side validation (JavaScript) on the forms, but other than
that, nothing else special about them.


JS validation is ok, but most defiantly should not be relied on.


Oh, most "defiantly" true ;-) SCNR.

js checks can be useful to both parties as an optional convenience,
but most certainly the submitted parameters must be fully[1] validated
at the server.

[1] where "fully" is defined by the requirements of the application.

hth
Jul 20 '05 #3
"Alan J. Flavell" <fl*****@ph.gla .ac.uk> wrote in message
news:Pi******** *************** ********@ppepc5 6.ph.gla.ac.uk. ..
On Fri, 30 Apr 2004, Michael Wilcox wrote:
This is a feature implemented in many browsers, but not all. You cannot
rely on it, since you cannot manipulate the user's browser.


right...
However, if a problem is encountered and an error is found by
checking it with PHP, you should be able to reconstruct the form and
fill in the values, all using PHP. The user shouldn't have to depend
on a feature his/her browser might not have.


Good answer. The same is true for other server-side scripting, though
- it's not limited to PHP: for example the CGI.pm module makes this
quite straightforward in Perl with CGI.
There is client-side validation (JavaScript) on the forms, but other than that, nothing else special about them.


JS validation is ok, but most defiantly should not be relied on.


Oh, most "defiantly" true ;-) SCNR.

js checks can be useful to both parties as an optional convenience,
but most certainly the submitted parameters must be fully[1] validated
at the server.

[1] where "fully" is defined by the requirements of the application.

hth


Thanks to both of you for your advice. I kind of thought it was a browser
specific feature.

I agree that JavaScript (JS) isn't generally the best tool, but in this
case, I think it works. The form(s) just takes the form data and sends it to
an e-mail account(s), and is never processed any further (database, etc.).
The JS just basically checks for null values and formatting, so when the
data is sent to the person in charge of the ceremonies, it is clear & makes
sense to them. I also have it so if the end-user has JS disabled, the submit
button is also disabled. I wrote the backend to replace a Pearl script that
our agency was not allowed to alter (working for state agencies is fun!),
and made it hard to manage & alter. Also, the person really in charge of the
forms (and site) is a "veteran" of 10 years in web dev that can't even write
simple JS. I wanted to do all of the validation server-side, but couldn't,
as I had to keep it as simple as possible for the co-worker.

Thanks again!

--
SamMan
Rip it to reply
Jul 20 '05 #4
Alan J. Flavell wrote:
Oh, most "defiantly" true ;-) SCNR.
Damn you convenient spell checker! *sigh* It's my own fault, but whatever...

Seems I'm not the only one. In
<http://www.w3.org/TR/AERT#color-contrast> I found, "The rage for color
brightness difference is 125. The range for color difference is 500."
Hmmm, I think the rage should be a little higher ;-)
js checks can be useful to both parties as an optional convenience,
but most certainly the submitted parameters must be fully[1] validated
at the server.

[1] where "fully" is defined by the requirements of the application.


A while ago I found a document saying that forms should be processed so
that users can enter info in a variety of formats and it will be parsed
correctly. The example of a phone number was given, and how so many
formats are used and how users shouldn't be restricted to three little
boxes for the numbers. (I was thinking it was a Korpela article, but I
couldn't find it.)

--
Michael Wilcox, http://mikewilcox.t35.com/
Jul 20 '05 #5
SamMan wrote:
I also have it so if the end-user has JS disabled, the submit
button is also disabled.


What good is that? How would I ever submit my form if my JS is off? Or
if I don't even have it?
--
Michael Wilcox, http://mikewilcox.t35.com/
Jul 20 '05 #6
"Michael Wilcox" <mj************ @yahoo.com> wrote in message
news:c6******** ****@ID-230276.news.uni-berlin.de...
SamMan wrote:
I also have it so if the end-user has JS disabled, the submit
button is also disabled.


What good is that? How would I ever submit my form if my JS is off? Or
if I don't even have it?
--

Because, like I said... the JS is only used to check for null values and/or
formatting of the fields. If JS is disabled, the form can be submitted with
all blank fields. The client does not want this. Just because JS is
disabled, doesn't mean the form submit button won't work.

--
SamMan
Rip it to reply
Jul 20 '05 #7
"Michael Wilcox" <mj************ @yahoo.com> wrote in message
news:c6******** ****@ID-230276.news.uni-berlin.de...
Alan J. Flavell wrote:
Oh, most "defiantly" true ;-) SCNR.
Damn you convenient spell checker! *sigh* It's my own fault, but

whatever...
Seems I'm not the only one. In
<http://www.w3.org/TR/AERT#color-contrast> I found, "The rage for color
brightness difference is 125. The range for color difference is 500."
Hmmm, I think the rage should be a little higher ;-)
js checks can be useful to both parties as an optional convenience,
but most certainly the submitted parameters must be fully[1] validated
at the server.

[1] where "fully" is defined by the requirements of the application.


A while ago I found a document saying that forms should be processed so
that users can enter info in a variety of formats and it will be parsed
correctly. The example of a phone number was given, and how so many
formats are used and how users shouldn't be restricted to three little
boxes for the numbers. (I was thinking it was a Korpela article, but I
couldn't find it.)

--

That is why I try and use regex whenever possible. :-)

--
SamMan
Rip it to reply
Jul 20 '05 #8
SamMan wrote:
Just because JS is disabled, doesn't mean the form submit button won't work.


I'll answer that with a quote from you: "I also have it so if the
end-user has JS disabled, the submit button is also disabled."

Does this mean that if I have my JS off, I can't submit your form?
--
Michael Wilcox, http://mikewilcox.t35.com/
Jul 20 '05 #9
"Michael Wilcox" <mj************ @yahoo.com> wrote in message
news:c6******** ****@ID-230276.news.uni-berlin.de...
SamMan wrote:
Just because JS is disabled, doesn't mean the form submit button won't
work.
I'll answer that with a quote from you: "I also have it so if the
end-user has JS disabled, the submit button is also disabled."

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.

--
SamMan
Rip it to reply
Jul 20 '05 #10

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
12227
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
5644
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
1408
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
11902
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
2236
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
9425
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
10057
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
10002
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
9869
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
6676
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
5312
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
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
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
3575
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.