473,545 Members | 289 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 6293
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($_SERV ER["HTTP_ACCEP T"],
"applicatio n/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******* *************@n ews4.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($_SERV ER["HTTP_ACCEP T"],
"applicatio n/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******* *************@n ews4.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
19316
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 able to fill that one out just fine. The second form is multipart/form-data. Unfortunately, I haven't been able to fill that out in a way that makes...
3
1702
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 calling form? For example, say off of my main form I launch a modal dialog box that gets the username and password what is the best way of...
15
6552
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 the buttons. The problem is when I post a form to itself, the Enter key will not submit the form, it only clears the contents of the text box. The...
6
3087
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 should be submitted as if the button is pressed. Is this correct? Does this behaviour vary across browsers? Chris
4
2794
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 the user to select multiple files. As you may know, the tag produces a text input field with an adjacent button for selecting a file from the local...
7
2271
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 in summary form, in hopes that someone might have an idea about what's going on. I am using a bound form which is losing data a significant...
7
2302
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 I had pressed the Button). I want the Form to go to the server when the Button - and not the Enter key - is pressed. ???
5
2081
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 rather than using the html <form> and related tags. Can this be done to support both IE, Firefox? Any code snippets or samples showing how to do...
16
2842
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 ass and the app will be used internally so I'm not too worried about users who aren't using javascript. I'm using the following javascript to detect...
0
7398
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...
0
7805
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...
1
7416
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...
0
7752
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...
1
5325
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...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
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
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.