On form submission I'm using jQuery to gather data including files and creating a FormData Object of the form values using:
var formData = new FormData($("form#formid")[0]);
but how can I add another value and it's key to this FormData Object?
var formData = new FormData($("form#formid")[0]);
formData.append("key", "value")
See https://developer.mozilla.org/en/XMLHttpRequest/FormData
You can also use FormData.set().
The difference between FormData.set and append() is that if the specified key already exists, FormData.set will overwrite all existing values with the new one, whereas append() will append the new value onto the end of the existing set of values.
Syntax:
formData.set(name, value);
serialize()could handle files?