Forum: Ruby on Rails More Back Button Madness

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5cd805eda9338f43deaa498a22588a9f?d=identicon&s=25 Desert Penguin (desertpenguin)
on 2007-04-27 17:19
I am having problems with form fields retaining values when the user
hits the back button.  This occurs with standard pure html forms, like:

<form action="/test" method="post">
        Title: <input id="product_title" name="product[title]" size="30"
type="text"/>
                        <input type="submit" >
</form>

If the user fills in the text field and submits, or browses to another
page, when they hit the back button the form is blank.

I only get the error when using IE and the page is being served with
Webrick.

Does anyone have any ideas what might cause this?


Thanks for any advice/tips...
5cd805eda9338f43deaa498a22588a9f?d=identicon&s=25 Desert Penguin (desertpenguin)
on 2007-04-27 17:53
Well I figured it out.

It was caused by the no-cache header rails automatically adds.

Safari and Firexo correctly handle it.  IE 6 decides to save the
original state of the form and ignore any user input.  Great. Another
bunch of hours wasted.

BTW - both of the following work in IE 6
@response.headers['Cache-Control'] = ' '

@response.headers['Cache-Control'] = 'private'

Of course, on the private one turns off caching.

Stop the madness...



Desert Penguin wrote:
> I am having problems with form fields retaining values when the user
> hits the back button.  This occurs with standard pure html forms, like:
>
> <form action="/test" method="post">
>         Title: <input id="product_title" name="product[title]" size="30"
> type="text"/>
>                         <input type="submit" >
> </form>
>
> If the user fills in the text field and submits, or browses to another
> page, when they hit the back button the form is blank.
>
> I only get the error when using IE and the page is being served with
> Webrick.
>
> Does anyone have any ideas what might cause this?
>
>
> Thanks for any advice/tips...
This topic is locked and can not be replied to.