M
M
Maybe_V2016-08-22 23:18:06
JavaScript
Maybe_V, 2016-08-22 23:18:06

How to save form data after navigating to another page?

There is a form on the page, submmitno buttons!

How can you save form data when the page is reloaded or the user navigates to another page!

I work with yii2. Perhaps there is a ready -made jqueryplugin?

I tried to make $('#form').submit()the result seem to be there (the data is saved), but when it goes to the controller where the form is saved, you need to redirect somewhere or go to an empty browser page! Perhaps you can make the controller just run and return nothing?

Or what is the best way to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2016-08-23
@bitver

Store data in the browser and don't worry.

M
Maxim Timofeev, 2016-08-23
@webinar

Doing ajax send when focus is lost is the most correct option.
You can also write to the localStorage or sessionStorage of the browser, according to the situation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question