B
B
budyakov2011-05-24 16:08:53
Online shopping
budyakov, 2011-05-24 16:08:53

Saving form data immediately after input?

The task is to improve the life of users:
When filling out an order form for goods in an online store, I want to save the entered data immediately after the transition from one field to another has occurred. Those. the person filled in the name and phone number, and then, while filling in the address, for example, the browser crashed. After restoring the page, I would like to have those fields filled in that he managed to fill out. How to implement?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
Roman Gogolev, 2011-05-24
@romka777

save javascript in cookies

K
konfuze, 2011-05-24
@konfuze

Try Browser Storage. There is a js-library that implements cross-browser support for this technology.

A
Alexander, 2011-05-24
@xel

hang on the onchange event saving the fields with ajax
something like getting data when the page is loaded, I think it will not be a problem to do
$("input[type=text]").bind("onchange", function(){
$.post("ajax.php?saveData", { "name": $(this).attr("name"), "value": $(this).val() })
});

R
ramilexe, 2011-05-24
@ramilexe

Send by Ajax to the server in the onblur event of inputs and save to the session.

I
Ivan Vasiliev, 2011-05-24
@konclave

I support. Try it via web storage . If you need support for browsers that can't, there are techniques to implement.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question