0

When I submit the form (eg: below), url gets redirected to localhost:8000/test/result/, and I get some result. This step works fine.
However, when I click on browser back button to go back to the initial form, Firefox doesn't load the form, although url has changed to localhost:8000/test/. I get a blank page. Also, if I click the back button again, it takes me to localhost:8000 page. Chrome and IE works though.
What am I doing wrong and how can I fix this FF issue?
Many thanks in advance.

#---test.html---
<form id="input-form" action="{% url test.views.main_view %}" method="post" enctype="multipart/form-data">{% csrf_token %}
...
</form>

#---views.py---
class MainView(FormView):
    template_name = 'test.html'
    form_class = UserInputForm
    success_url = 'result/'

    def form_valid(self, form):
        ...

#---urls.py---
urlpatterns =  patterns('test.views',
    url(r'^$', view='main_view', name='main-view'),
    url(r'^result/$', view='result_view', name='result-view'),
)
DGT
  • 2,604
  • 13
  • 41
  • 60

1 Answers1

1

I have a feeling this is the issue. Failing that, something that will definitely work is setting your Cache-Control header to “no-cache, must-revalidate, no-store” – but that's a nasty brute force solution.

Community
  • 1
  • 1
Matt
  • 8,758
  • 4
  • 35
  • 64