How do I add add an extra parameter to a multipart HTML form using Javascript? For a normal form, I am overriding the form submit method and appending the data like here -
(function (submit) {
HTMLFormElement.prototype.submit = function () {
var tokenValue = $('#_csrf');
//var tokenValue=token.val();
tokenValue.appendTo(this);
submit.call(this);
};
})(HTMLFormElement.prototype.submit);
And it gets it get attached like this -
_csrf:b0b386ae-7c33-4941-ad23-afd42ee88711
Where as for multipart form, it appears like this -
------WebKitFormBoundary7BYn6AhxBkI3hnrG Content-Disposition: form-data; name="_csrf"
i.e. only the name of the parameter