views:

18

answers:

0

Hi can anyone assistant me with getting this piece of jquery code to work properly. I like jquery but a lot of the times developers are very vague on how to use there custom coding. I guess they just assume you should know certain things. I'm trying to use this on a Form with checkbox, radio, dropdown and inputbox then have a php file handle the query updates.

http://plugins.jquery.com/project/autosave

$("input").autosave({
    // Defaults to parent form url or window.location.href
    url: url,
    // Defaults to parent form url or get
    method: "post", 
    // Defaults to false. Whether all "input" should be sent in the request or only the one it was triggered upon
    grouped: true,
    success: function(data) {
        console.log(data);
    },
    // Defaults to JSON, but can be XML, HTML and so on
    dataType: "json",
    send: function() {
        // Do stuff while we wait for the ajax response, defaults to doing nothing
        console.log("Saving");
    },
    error: function(xmlReq, text, errorThrown) {
        // Handler if the ajax request fails, defaults to console.log-ing the ajax request scope
        console.log(text);
    }
});