Amphtml: Intent to Implement: AMP Forms Support

Created on 26 May 2016  Â·  14Comments  Â·  Source: ampproject/amphtml

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:

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

Other issues to track:

  • [x] Prevent double-submissions while the request is still being processed
  • [x] Respect novalidate even on non-supported browsers #3469
  • [x] Cleanup rendered submissions templates during submit #3587
  • [x] Add Styles to display error/success containers to amp-form.css
  • [x] Form submission fail when using GET and native Fetch API #3736
  • [ ] Fieldsets marked valid when having invalid inputs on non-blink browsers #3898
  • [x] Make custom validation and polyfills accessible - #3880 #3872 #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.

INTENT TO IMPLEMENT Feature Request

Most helpful comment

Is there a timeline on when AMP Forms Support will be added?

All 14 comments

Is there a timeline on when AMP Forms Support will be added?

@HerbertL: experimental forms support has been available since June, and we have an ampbyexample sample.

is there a mean working on a non htpps server ?
thanks in advance for all answer.

@apch54 no not currently. I am not even sure if non-secure endpoints would be allowed in the future.

cc/ @dvoytenko @cramforce for more details.

All AMP protocols are allowed to be tested on http://localhost in dev modes. But not on any non-localhost http server.

Team:
I have an Form that captures information like username, email ID and mobile number in TEXT area and gives the option of dropdown box to select Location. This information is then sent to my server when the user taps the SUBMIT button. Can you'll guide me how i can incorporate the same using AMP.
( I am new to AMP)

The ability to support this is being developed under this issue. Much of the functionality is built, but is only available experimentally pending the entire feature being ready to launch. If you want to try it out, you can use pages like https://ampbyexample.com/components/amp-form/ to get started.

Thanks Rudy for the prompt reply.. surely i will be trying out and sharing
my experience

On Thu, Sep 8, 2016 at 10:28 PM, Rudy Galfi [email protected]
wrote:

The ability to support this is being developed under this issue. Much of
the functionality is built, but is only available experimentally pending
the entire feature being ready to launch. If you want to try it out, you
can use pages like https://ampbyexample.com/components/amp-form/ to get
started.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ampproject/amphtml/issues/3343#issuecomment-245664859,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVDPqn8AzH8Pa3mR7Slqty4miaP-VbLxks5qoD6fgaJpZM4In17m
.

Great work on this! Just wondering when will this be out of experimental stage since some components such as submit-success fail the AMP validation. I see that there's only one issue left which is in regards to fieldsets validation.

The submit-success validation is being tracked here: https://github.com/ampproject/amphtml/issues/5268#issuecomment-250048435

@rudygalfi I see, thanks! I hope this is the right place to ask but I was wondering If the form component is no longer prohibited as it passes the validation (after including the amp-form extension) and whether it can be used in production-ready AMP documents. The docs state it is as experimental and also state that experimental components will fail validation.

Experimental means that things might change and could still break your docs without notice. The component is close to stable and we don't anticipate that (in fact, the validation problem I noted in my previous comment is the main thing we're tracking to fix before calling this stable).

HI.. Why is this closed?

On Fri, Oct 28, 2016 at 6:38 AM, Mohammad Khatib [email protected]
wrote:

Closed #3343 https://github.com/ampproject/amphtml/issues/3343 via #5815
https://github.com/ampproject/amphtml/pull/5815.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ampproject/amphtml/issues/3343#event-839457502, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AVDPqm0mmlPWZNhDbuBkOznv8WX6kGZaks5q4UsbgaJpZM4In17m
.

Because it shipped :)

On Thu, Oct 27, 2016 at 8:16 PM, Biju Nair [email protected] wrote:

HI.. Why is this closed?

On Fri, Oct 28, 2016 at 6:38 AM, Mohammad Khatib <[email protected]

wrote:

Closed #3343 https://github.com/ampproject/amphtml/issues/3343 via

5815

https://github.com/ampproject/amphtml/pull/5815.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ampproject/amphtml/issues/3343#event-839457502, or
mute
the thread
AVDPqm0mmlPWZNhDbuBkOznv8WX6kGZaks5q4UsbgaJpZM4In17m>
.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ampproject/amphtml/issues/3343#issuecomment-256826575,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFeT9JmAgg8xadS2tysCTmweKjEKny-ks5q4WkMgaJpZM4In17m
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vockalimo picture vockalimo  Â·  49Comments

retornam picture retornam  Â·  52Comments

zhouyx picture zhouyx  Â·  103Comments

aghassemi picture aghassemi  Â·  43Comments

darobin picture darobin  Â·  48Comments