How often we are confronted with the fact that while filling out certain forms on websites, when writing large texts on a blog or forum, a computer suddenly freezes. Or "disappears" the Internet. Or a finger accidentally hits the navigation buttons (for example, “Back”), which so “helpfully” the manufacturers of laptops and keyboards have in the most inconvenient places.
The result is always the same - we lose all the data that we have already collected. We lose precious time to restore the already typed text, we get upset ... And, I think, the most expressive personalities have already broken more than one keyboard - like a vent where you can break all the anger.

')
Let's look at the different ways in which you can solve the problem of "not losing your data."
№ 1 - “The rescue of the drowning is the work of the drowning”After I personally lost several large enough typed texts myself and quite emotionally spoke out about this, my colleagues suggested a great plugin for Firefox and Chrome -
Lazarus .
Lazarus periodically locally saves the data of filled forms, is able to work with visual editors and AJAX-forms. For security reasons, the data saved to disk is encrypted.
You can recover data in just two clicks!

Overall, great stuff!
Except for a couple of drawbacks: firstly, not all browsers are supported, and secondly, the method is not applicable, for example, in an Internet cafe.
No. 2 - "We use modern technologies - HTML5 Local Storage"If the user himself is not always able to protect himself, maybe the site developers should take care of him?
All modern browsers support this HTML5 feature as Local Storage. In fact, it is a local database in which you can save key-value pairs.
And Local Storage can be used to automatically save data in web forms. At Habré, this approach has already been discussed, and even
ready-made solutions are presented that developers can use in their projects.
No. 3 - “We save data not locally, but on the server”In the 11th version of “1C-Bitrix: Site Management” there was a function of automatic saving of web form data.
We considered different solutions to this problem. Including, of course, thought about the possibility of using Local Storage. As a result, identified several key flaws, because of which they abandoned this idea.
- The main issue is security. Multiple people can work on a single computer, and storage is common (for a single browser). The method is not applicable at all in public places (Internet cafes). Data can be read from the local repository by a virus, trojan, etc.
- I want independence from the local computer. The battery in the laptop sat down, "flew" the disk ... Such situations, of course, are not too frequent, but still it is nice to just open any other browser on another computer / mobile device and continue working.
Therefore, we decided to implement the server-side autosave feature, linking the data to the user profile, rather than locally.
Thus, both issues are resolved: the security and safety of data is ensured, and the mechanism is universal - it works completely transparently and independently of the browser.
How it works?If your site is powered by 1C-Bitrix Site Management 11th version, the autosave function is already enabled on most web forms of the administrative section, as well as in the forms for adding / editing pages and information block elements. In the near future, autosave will be enabled on blogs and forums.
If autosave works on the form, then in the right corner of the form (when editing in the administrative part) the following icon will appear:

In the forms called in the public part, the icon is located in the lower left corner of the form:

Autosave happens all the time while the user edits the form. You can click on the icon and save manually - just in case. :) Well, or as an option of “extreme draft”. :)
If some failure occurred during the creation of a new element, and not in the editing process, then autosave will work for the form for creating the corresponding new page / element. That is, the next time the addition form is opened, you will be prompted to restore the data.

We hope that the autosave function will make your work more comfortable and allow you to save a lot of nerves and so expensive in our fast-moving age. :)