Adds support for enctype="application/json", more HTTP methods and HTTP status codes to HTML forms
npm install html-form-enhancerhtml-form-enhancer
==================
This package contains a small javascript utility that adds a few features
to HTML forms that are often requested, but don't exists in browsers:
* enctype="application/json" to encode form fields to JSON.
* Support for additional methods such as PUT, DELETE, PATCH, REPORT,
SEARCH.
* Support for the 201 status code. If 201 is returned with a Location
header, the form will switch its method to PUT and action to the new
location.
* Support for the 204 and 205 status codes.
* Follows: https://www.w3.org/TR/html-json-forms/
Usage instructions
------------------
Including this script with a tag will cause it to scan for tags in the DOM and automatically run.
``html
If you use Javascript to dynamically render forms, you can also re-run the
script on specific form elements:
`javascript
import { enhanceForm } from 'html-form-enhancer.mjs';const elem = document.getElementById('.some-form');
enhanceForm(elem);
`How it works
------------
The script finds all existing