Jquery: Push FormData?
form-data, javascript, jquery
Solution
If I'm understanding your question correctly, you want to add extra keys and values to the FormData object after taking them from the form. If so, yes you can! It uses the `append` method:
data.append('SomeField', 'SomeValue');
You can do this with a string, or with a `Blob` or `File` object as suits you.
This is documented in the MDN page for `FormData`.
Problem
Is there a way to add additional data to a formdata element that handles a file upload? I know formdata doesn't support .push()? ``` $("frm").submit(function (e) { e.preventDefault(); var data = new FormData($(this)[0]); }); ```