Help really appreciated: Form caching problem

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
supergrover1981
Forum Newbie
Posts: 11
Joined: Sun Nov 26, 2006 6:36 am

Help really appreciated: Form caching problem

Post by supergrover1981 »

Hi Guys,

I'm currently having a problem with a GET submission. If anyone has any suggestions I'd be most appreciative. Here's the problem:

I'm working on a site which, on the front page, has a hidden input field declared with value="any". This value can be changed by a javascript call of onclick="basicsearch.primarycolour.value='xyz'"

The form works fine, but if I go back to the same submission page (even after pressing refresh) without first shutting down the browser, it posts the remembered value of the hidden form, NOT the default value set in the (input name=xyz value="any") html.

If I click on a javascript button which sets a different value via onClick it posts the new value, but unless i do that, the page seems to ignore the value set in the input field.

A few things:

- My PHP includes no session variables
- The screen with the form in it does not receive any _GET/_POST variables from other pages
- No cookies set in my PHP

If anyone has any idea on how to make these pesky forms "forget" the previous submission, I really would be most appreciative - it's doing my head in. :-)
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That sounds like a browser caching problem. Why do you have Javascript setting a hidden field? What happens if someone has Javascript disabled or just isn't supported?
Post Reply