DataTabels to MySql
DataTabels to MySql
Hi,
I need away to pass the updated table to mysql. One way I was looking at doing this was:
$('#form').submit( function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
var nData = $('input', oTable.fnGetNodes()).serialize();
alert( "The following data would have been submitted to the server: \n\n"+nData );
$.post("saveupdate.php", { data : nData });
});
But this is not correctly posting the table.
How have other people done this?
Many Thanks
Chris.
I need away to pass the updated table to mysql. One way I was looking at doing this was:
$('#form').submit( function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
var nData = $('input', oTable.fnGetNodes()).serialize();
alert( "The following data would have been submitted to the server: \n\n"+nData );
$.post("saveupdate.php", { data : nData });
});
But this is not correctly posting the table.
How have other people done this?
Many Thanks
Chris.
This discussion has been closed.
Replies
Note that the jQuery documentation says the $.post() expects data to be a key/value pair, rather than a string ( http://docs.jquery.com/Ajax/jQuery.post#urldatacallbacktype and http://docs.jquery.com/Ajax/serialize ).
A quick look at the jQuery documentation suggests that you might be able to use serializeArray(). If this doesn't work, then this is probably one for the jQuery discussion list rather than a specific DataTables question.
Regards,
Allan