0

I'm using Django 1.9.9 with the i18n set_language view to change website languages.

I have some pages with forms on them, e.g. for collecting project-specific user data. When a user enters data into such a form, but changes the language before saving the form, the entered data is lost.

Is there a way to prevent this from happening?

Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130

1 Answers1

0

You can write a small js event handler that on saves all the data in localstorage when clicking the set language link, and repopulates the form on page load.

Udi
  • 29,222
  • 9
  • 96
  • 129