Jump to content

Help really appreciated: Form caching problem


supergrover1981

Recommended Posts

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. :-)
That's the browser doing that.. one way to fix it is to make sure your users fetch the page again, rather than going back in the browser.  You can force that by getting the browser not to cache the pages (I'm not sure of the mechanism to do that).

If you want to solve it in the browser itself, look at javascript rather than php.  And don't trust IE for refreshing pages.
*grin*

Cheers Btherl,

I was trying a JavaScript onLoad call that wasn't working - forgot about the fact that my form was inside a small iFrame. JavaScript worked a treat once I realised the mistake. :-)

Cheers,
          - JB

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.