IE - Refresh issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

IE - Refresh issue

Post by facets »

Hi All,

When I refresh a page in IE I loose form data.
Is there any way to keep it?

I can supply more detail if necessary.
Firefox doesn't behave this way.

Cheers, Will.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you'd have to resubmit the posting information, so a hidden set of form data could do it, however hitting refresh in the browser wouldn't activate such page logic.
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

Age old question.
Why would firefox behave differently?

I have to refresh the page because within the form the the user can update the data base which drives many dropdown menus.

so, the users clicks a javascript button and pops up a window and adds data to the db, close this window.
then i force the page to reload to include the newly added data to the drops down menus.

this method was used to work around the nested forms issue.

does that sound right?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Heh.... another situation where AJAX would prove very handy, although not strictly needed.

When you do thet refresh, what you should actually do is to submit the data via POST or GET and collect it at the server end, perhaps put it into a SESSION.

Once you have that info you can put it back into the form value attributes when the page reloads ;)
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

d11wtq wrote:Heh.... another situation where AJAX would prove very handy, although not strictly needed.

When you do thet refresh, what you should actually do is to submit the data via POST or GET and collect it at the server end, perhaps put it into a SESSION.

Once you have that info you can put it back into the form value attributes when the page reloads ;)
Alternatively, you could check for when the page is being exited via:

Code: Select all

<body onbeforeunload="/* Do some crazy stuff */">
...and have a JS function attached to it to check if the user tried to refresh the page using either F5 or Shift-R or whaterver. I remember I used that for my chat script, can't remember the exact code though; plus I'm at school now so I don't have FTP access to it :? .
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

I don't suppose there is another way to reload just the drop down menu portion of a page without reloading the whole page?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

facets wrote:I don't suppose there is another way to reload just the drop down menu portion of a page without reloading the whole page?
You could via AJAX.

d11wtq | http://xaxjax.sourceforge.net
Post Reply