Post serialized form data and extra variables using JQuery
javascript, jquery, php
Solution
var serialized = $('#PageDetailForm').serialize();
serialized.thePage = thePage;
$.post("pagedetail.php", serialized,
function(data) {
alert(data);
});
Problem
I am trying to use this piece of code to serialize a form AND send an extra variable not found in the form, at the same time. The following line of code is what I expected, but sadly does not work. ``` var thePage = theFilename(); $.post("pagedetail.php", { $("#PageDetailForm").serialize(), thePage: thePage }, function(data) { alert(data); }); ``` Any ideas?