How can I set a custom field in POST header on submit a form?
From FormData documention:
XMLHttpRequest Level 2 adds support for the new FormData interface. FormData objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the
XMLHttpRequestsend()method.
With an XMLHttpRequest you can set the custom headers and then do the POST.