Skip to content

Intent to Implement: AMP Forms Support #3343

@mkhatib

Description

@mkhatib

AMP will allow the usage of HTML5 <form> and <input>s. Publishers and Developers wanting to use Forms in their AMP Docs would be required to include the amp-form extension. There would be no amp-form element provided initially though it might be introduced in the future if we see need to it.

For now the AMP Form extension will polyfill support for validation where missing and allow forms to be submitted in an XHR-request.

While in experiments we'll start adding these features:

  • Allow basic usage of forms and inputs
  • Submit via xhr, _top or _blank.
  • Validate and stop submission on Safari and other browsers that doesn't have validations-complete story
  • Allow rendering success and error states with data returned from the response
  • Build a tooltip component to be used when the builtin report UI is not available
  • Report Validation Errors on Webkit-based browsers that don't have builtin UI for error reporting.
  • Provide classes/attributes hooks to style different state of the form
  • Provide classes to style different states per input as the user jump between inputs
  • Allow users to always use custom validation messages instead of browser-provided UX
  • Expose submit event to allow on=submit:lightbox.close syntax.

Other issues to track:

This will probably go out of experiment as soon as the list above with the required validations are deployed.

Next we'll explore field-dependencies, data-loading and other features.

Metadata

Metadata

Assignees

Labels

INTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeType: Feature Request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions