Skip to content

amp-form: Submit Form on Input Change #4272

@sebastianbenz

Description

@sebastianbenz

Currently forms require a separate submit button, would be great if it'd be possible to omit the submit button if the form contains a single checkbox. Each click on the checkbox would then trigger an XHR request.

This would enable implementing favorite/bookmark actions directly in AMPs with amp-form.

Example:

  <form method="post" action-xhr="https://example.com/bookmark/12345" action="https://example.com/bookmark/12345" target="_top">   
    <input type="checkbox" id="favorite" checked>
  </form>

//cc @mkhatib

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions