-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
INTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeType: Feature Request
Milestone
Description
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,_topor_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
submitevent to allowon=submit:lightbox.closesyntax.
Other issues to track:
- Prevent double-submissions while the request is still being processed
- Respect
novalidateeven on non-supported browsers Forms should respect the novalidate attribute #3469 - Cleanup rendered submissions templates during submit Cleanup rendered templates during submissions in forms #3587
- Add Styles to display error/success containers to
amp-form.css - Form submission fail when using GET and native Fetch API Form submission fail when using GET and native Fetch API #3736
- Fieldsets marked valid when having invalid inputs on non-blink browsers fieldset.checkValidity always returns true #3898
- Make custom validation and polyfills accessible - [Accessibility issue] Click on subscribe button with empty Name and email does not read out as value missing from both text boxes #3880 Bubbles appear after the form for screenreader users #3872 XHR demo success text not announced by screen reader #3873
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
INTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeType: Feature Request