The Accelerated Mobile Pages project announced this week that it has launched support for forms in AMP HTML. The types of forms can range from simple email capture forms to interactive polls and more complex forms such as selecting colors on an e-commerce product page.
The amp-form extension supports both regular navigation and XHR form submissions, promising an improved overall experience in filling out forms.
Benefits of forms on AMP pages compared to regular pages include:
– Using the “on” attribute to change the page when the form is submitted. This attribute can also be used to change the page based on the success or failure of the form submission.
– Annotating fields upon submission by using templated response rendering. This feature provides contextual feedback on input errors in the fields.
– Styling fields based on validation status using CSS pseudo-classes, giving users real-time feedback on the validity of their input.
For more details on implementing forms on AMP pages, the information is available in the official documentation. Live examples of AMP pages with forms can be found in AMP by Example.
The AMP project plans to continue expanding form functionality based on user feedback. Additionally, the team is exploring further validation support and conditional behaviors.
“With this initial set of form support, we’re excited to see the innovative form-enabled experiences that developers create.”
It has been a little over a year since the AMP project was first introduced. Initially, its functionality was limited to providing stripped-down versions of news articles that loaded instantly on mobile devices.
Four months after its launch, in February 2016, AMP pages began appearing in search results, first in a dedicated AMP carousel typically displaying news stories from top publishers.
Today, several major milestones have been reached. With the functionality introduced over the past year, AMP technology has evolved beyond news publishers, becoming a versatile solution for various types of site owners.
Perhaps the most significant milestone is the indexing of AMP pages in Google search results. The AMP carousel was eventually removed, and AMP pages started appearing in the regular set of organic search results. This change provides searchers with greater access to AMP content and offers site owners more exposure for their AMP pages.
At just one year old, AMP is still in its early stages. It will be interesting to observe how it grows and evolves in 2017.