473,509 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loss of Form field contents when the browser BACK button is pressed

I have a website that uses Forms, and if I complete the form fields,
submit the form, realise that there was an error or omission, and then
hit the Back button, the form fields are all empty. This is extremely
frustrating.

However, what's more frustrating is that this behaviour doesn't happen
all of the time - sometimes the field contents will still be there,
and other times the fields will be empty. Also, sometimes the one form
will not retain its input whereas another form will.

Can anyone please explain what's going on? Is it an HTML issue or an
IE thing? More importantly, how do I fix it so that the form field
contents are always retained when I hit the Back button?

For background it's the same whether I use IE5 or IE6 - haven't tried
any other browsers. Also most of the forms are on basic JSPs, or JSPs
with Struts; but there doesn't seem to be any consistency in which
pages display this behaviour. Sometimes it's the simple JSPs and other
times it's the Struts ones.

Any help would be gratefully received.
Jul 23 '05 #1
4 6289
Jonathan Strange wrote:
I have a website that uses Forms, and if I complete the form fields,
submit the form, realise that there was an error or omission, and then
hit the Back button, the form fields are all empty. This is extremely
frustrating. Can anyone please explain what's going on? Is it an HTML issue or an
IE thing? More importantly, how do I fix it so that the form field
contents are always retained when I hit the Back button?

For background it's the same whether I use IE5 or IE6 - haven't tried
any other browsers. Also most of the forms are on basic JSPs, or JSPs
with Struts; but there doesn't seem to be any consistency in which
pages display this behaviour. Sometimes it's the simple JSPs and other
times it's the Struts ones.

Any help would be gratefully received.


You could post a link to a page to show the
problem (help us to help you...)
Both Firefox and Opera are free to download.

Anyway, I had the same problem with my php form,
it was solved when I replaced
<?php
if (stristr($_SERVER["HTTP_ACCEPT"],
"application/xhtml+xml")) {
header("Content-type: application/xhtml+xml;
charset=iso-8859-1");
} else {
header("Content-type: text/html;
charset=iso-8859-1");
}
?>
with
<?php header("Content-Type: text/html;
charset=iso-8859-1"); ?>

And I'm curious - has JSP anything to do with
javascript? Do we need to enable javascript to use
your forms?
--
Inger Helene Falch-Jacobsen
http://home.online.no/~ingerfaj/
Jul 23 '05 #2
On Fri, 26 Nov 2004 09:10:19 +0100, Inger Helene Falch-Jacobsen
<In***@neseblod.invalid> wrote:

[snip]
And I'm curious - has JSP anything to do with javascript?


No. JSP - JavaServer Pages (<URL:http://java.sun.com/products/jsp/>).
Effectively, server-side programming with Java.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3
Inger Helene Falch-Jacobsen <In***@neseblod.invalid> wrote in message news:<Mx********************@news4.e.nsc.no>...
Jonathan Strange wrote:
I have a website that uses Forms, and if I complete the form fields,
submit the form, realise that there was an error or omission, and then
hit the Back button, the form fields are all empty. This is extremely
frustrating.

Can anyone please explain what's going on? Is it an HTML issue or an
IE thing? More importantly, how do I fix it so that the form field
contents are always retained when I hit the Back button?

For background it's the same whether I use IE5 or IE6 - haven't tried
any other browsers. Also most of the forms are on basic JSPs, or JSPs
with Struts; but there doesn't seem to be any consistency in which
pages display this behaviour. Sometimes it's the simple JSPs and other
times it's the Struts ones.

Any help would be gratefully received.


You could post a link to a page to show the
problem (help us to help you...)
Both Firefox and Opera are free to download.

Anyway, I had the same problem with my php form,
it was solved when I replaced
<?php
if (stristr($_SERVER["HTTP_ACCEPT"],
"application/xhtml+xml")) {
header("Content-type: application/xhtml+xml;
charset=iso-8859-1");
} else {
header("Content-type: text/html;
charset=iso-8859-1");
}
?>
with
<?php header("Content-Type: text/html;
charset=iso-8859-1"); ?>

And I'm curious - has JSP anything to do with
javascript? Do we need to enable javascript to use
your forms?

Unfortunately the site is behind a company firewall so you wouldn't be
able to access it anyway.

As for the solution you applied to your php form, I have absolutely no
knowledge of php and wouldn't know how to apply it to JSP.

Thanks anyway!
Jul 23 '05 #4
Jonathan Strange said the following on 11/26/04 18:06:
Inger Helene Falch-Jacobsen <In***@neseblod.invalid> wrote in message news:<Mx********************@news4.e.nsc.no>...
You could post a link to a page to show the
problem (help us to help you...)


Unfortunately the site is behind a company firewall so you wouldn't be
able to access it anyway.


You could try to make a bare bone version of that site/page and put it
up a web server which is accessible to all of us. By making a bare bone
version you might find the problem yourself.

I think Spartanicus has a page about this concept, but I can't find the
URL to it. Someone?

--
Regards
Harrie
Jul 23 '05 #5

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

Similar topics

10
19308
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
3
1698
by: RubiconXing | last post by:
Hi All Beginner question - please be patient with me :-) I am new to c#. If one creates a child modal (and also non-modal) form what is the best way of returning the collected data back to the...
15
6544
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
3081
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
4
2792
by: John Fereira | last post by:
So, one of the limitations of multipart-form handling is that when an <input type="file" ..> tag is used it will bring up a window which allows a user to select a file for upload but won't allow...
7
2264
by: Neil Ginsberg | last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7 back end, using ODBC linked tables. I previously wrote about this, but am reposting it with some additional information and...
7
2301
by: marcia | last post by:
In a Web Form with a Button and a TextBox, when I type some characters in the TextBox (AutoPostBack == false) and then hit the Enter key on the keyboard, the Web Form goes to the server (as though...
5
2076
by: Mike Dee | last post by:
Is it possible to dynamically create a new form object (form1), then create a new form field object and add it form1, and then add form1 to the current document? I need to do all this in script...
16
2836
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
0
7237
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,...
0
7137
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...
0
7347
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
7416
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...
1
7073
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
5656
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,...
1
5062
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...
0
3218
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...
1
779
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.