I have an array of serialized form information (collected using the serialize functionality in jQuery), and would like to add additional information to it. From what I've read it looks like I need to use the push function in Javascript. Unfortunately when I try this I get an error message saying that 'formData.push is not a function'
My code:
$('#sendForm').live('click',function(){
var formData = $('#form').serialize();
alert(formData); //Returns as expected
var newArray = ['test','test2']; //The new data....
formData.push(newArray);
});
Any ideas on what I'm doing wrong?
Thanks!