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'),
)