October 2017
Intermediate to advanced
370 pages
8h 57m
English
Now we come to a neat trick in AMP. We can use amp-mustache templates to parse the form response and automatically populate and display a success or error message as appropriate.
To set this up, we need to do the following:
So our form will look like this:
<form method="post" action-xhr="/ch6/signup-xhr.php" target="_top"> ... <div submit-success> <template type="amp-mustache"> ...
Read now
Unlock full access