$.Post with Form submit

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-12-24T01:36:34Z Indexed on 2010/12/24 1:54 UTC
Read the original article Hit count: 526

Filed under:
|
|
|
|

...Some form gets submitted...

$.("form").submit(function() {
saveFormValues($(this), "./../.."; }

function saveFormValues(form, path) {
var inputs = getFormData(form);
var params = createAction("saveFormData", inputs);
var url = path + "/scripts/sessions.php";
$.post(url, params);
}


The weird thing is that if i add a function to the
$.post(url, params, function(data) {
alert(data); }

I get a blank alert statement.

Within scripts/sessions.php i have a function to save whatever the $_POST information is to a file, and the sessions.php never saves this saveFormValues call. It never shows up to the file. But if i keep trying to get it to save, about once every 15 will actually allow it to be saved. This leads me to believe that the forms POST is somehow blocking this value saving post. Any help?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery