Forum Moderators: coopster
I have a form and I thought I had a caching issue but I believe the problem is a completely different one than originally thought.
Everytime I revisit the page (wishing to do a new submit) it always likes to resubmit any information I have submitted previously.
How can I make it so the browser stops sending the previous information and start fresh without it sending the post data to my form?
I have a form in a single file style.
So it looks like.
if ( form has been submitted without error)
{
do something
}
else
{
display the form and indicate any errors or omitted fields
}
Any help would be appreciated
I can't say as I totally understand the behaviour you are describing but maybe try taking the processing out out of the form and move it into a seperate script.
Also if it submits everytime you hit the page your if($submit) test probably isn't working.
If you mean it just fills the form again it may just be your browser filling the form in for you.
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
So, let the form be submitted to one script... and let this script send a new header to a different file...
My form is refilling in values because it fills them in based on the previous post data variables which implies to me it is an issue with my script and the browser.
I believe my if submit is working properly and it seems like the browser remembers the previous post data submitted.
I could move the processing into a separate file which would elminate the problem I speak about but then I would not be able to keep filling in the correct values when some other fields are omitted.
DrDoc
thanks for the tips, I am checking out those links now.
I just re include the form to do that. Another trick I have used when forms start misbehaving is to change the form name to trick my browser into not completing it.
Sometimes you need to just shut down the browser, clear cookies, clear cache and anything else you can think of, just to get an idea of how exactly it's misbehaving.
I think I have identified how it is misbehaving. This is probably due to the nature of my script though.
I however, am not quite clear why it does this only that is partly due to the style of my script.
If I make one submission and then in the same browser window go to the same url of the form, it gives me the previous result still. Meaning it seems to automatically remember and post the same data.
I believe my if ( $Submit ) is working properly because if I open a up a new window and don't submit at all, the script behaves accordingly.
Would it help if I pasted the entire code? I am hesitant because it is quite long but maybe that would make things clearer.
support.powweb.com/tutorials/phpautoresponder.php
If you test the code by entering your name and click submit the script will ask for omitted fields to be filled in.
Then revisit the same page by going to the url again in your browser and you'll see you see the same results as before as if you resubmitted the same information. Instead I would like to see this behaviour stop and have the form display as if there was nothing submitted.
Hopefully this can bring us closer to finding a solution here.
[edited by: jatar_k at 8:32 pm (utc) on Nov. 19, 2003]
[edit reason] delinked [/edit]
It doesn't do it for me at all. I think it is your browser doing it and actually has nothing to do with the script. Maybe use an auto generated random form name so your browser can't auto fill because it can't identify it as the same form.
I notice that on IE6 I have the problem still but based on what you said I decided to try Opera and Opera does not produce this problem.
Even though this may be a browser issue is there a work around for this? The problem is that most people use IE6 so if somehow any of you can help find a way to fix this that would be great.
I've seen other forums and tutorials where people have complained of the problem I have noticed but no one can really find a solution to it as far as I can see.
If there is no solution can anyone show me a similar or least complex way to get the same results in the code above?
Thanks again everyone
I hope I can find a work around though, maybe changing the form name will help. I'll keep you guys posted.