diff --git a/README.md b/README.md index e45e8d7..2853987 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Note that in the following example the CSRF element is marked with the `data-csr - `csrf` is the [CSRF][] token for the posted form. It's available in the request body as a `authenticity_token` form parameter. - You can also supply the CSRF token via a child element. See [usage](#Usage) example. - `required` is a boolean attribute that requires the validation to succeed before the surrounding form may be submitted. +- `http-method` defaults to `POST` where data is submitted as a POST with form data. You can set `GET` and the HTTP method used will be a get with url encoded params instead. ## Events diff --git a/custom-elements.json b/custom-elements.json index 3a59cb4..026d746 100644 --- a/custom-elements.json +++ b/custom-elements.json @@ -56,16 +56,8 @@ }, "members": [ { - "kind": "method", + "kind": "field", "name": "setValidity", - "parameters": [ - { - "name": "message", - "type": { - "text": "string" - } - } - ], "inheritedFrom": { "name": "AutoCheckValidationEvent", "module": "src/auto-check-element.ts" @@ -92,16 +84,8 @@ }, "members": [ { - "kind": "method", + "kind": "field", "name": "setValidity", - "parameters": [ - { - "name": "message", - "type": { - "text": "string" - } - } - ], "inheritedFrom": { "name": "AutoCheckValidationEvent", "module": "src/auto-check-element.ts" @@ -206,6 +190,14 @@ "type": { "text": "string" } + }, + { + "kind": "field", + "name": "httpMethod", + "type": { + "text": "string" + }, + "readonly": true } ], "attributes": [ diff --git a/examples/index.html b/examples/index.html index 5818f59..9a0a48a 100644 --- a/examples/index.html +++ b/examples/index.html @@ -13,28 +13,28 @@

auto-check-element

Simple form

Input 422 for an error response.

- +

All fields marked with * are required

- - + +

Form that has custom validity messages

Input 422 for an error response.

- +

All fields marked with * are required

- - + +

@@ -42,12 +42,25 @@

Form that has custom validity messages