I know that these types of questions are not valid in the community but I was looking for information all afternoon. So I want to implement this kind of forms before they are sent to the controller. Does anyone know how I can do it? Or do you have an example that you have seen, they would help me a lot.
You can save any data you want to localstorage.
note: before saving convert it to string, with JSON.stringify()
and retrieve it as follows:
more information: https://www.w3schools.com/html/html5_webstorage.asp
you must use ajax to send data from javascript to a server language.
example of sending variables from js to php
and the server login.php: it has to receive the data variable
With the recovered data you must make the appropriate queries to insert into the database.
If you want to do some kind of offline session, you can save the new records locally. There are different ways, one is using an embedded database like LokiJS or alaSQL . If the app is small you can use
local/session storage
.For example, using alaSQL :
If you want a MongoDB-style database client, then you will like LokiJS.
If the records are few, then just use
sessionStorage
.Through an AJAX request: