views:

26

answers:

2

Hi, What are the option available to autosave the value of control when enter the control value in to the web page.Thanks inadvance

+1  A: 

you want to save the input value right after the users writes on it? i mean without having to click on a submit button?

var SaveField = function(value, fieldname) {
    var data = { value: value, fieldname: fieldname }; 
    $.ajax({
       url: "saveinput.php",
       data: data,
       type: "POST",
       error: function() {
           alert("error saving your data");
       }
    });
}

$("#inputId").change(function() {
    var value = $(this).val();
    var fieldname = $(this).attr("name");
    SaveField(value, fieldname);
});
GerManson
A: 

If you need to save into the database you need the GerManson code , but if you need to save the forms state to recover it later you need a cookie session, you can do it with JQuery cookie plugin.

Felix Guerrero