question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request for amp-form and extended template reference by id

See original GitHub issue

As it is done in amp-list, allow amp-form to select an extented template like this


<form method="post"
      action-xhr="https://ampbyexample.com/components/amp-form/submit-form-input-text-xhr"
      target="_top"
template="amp-template-id">
    <input type="text"
        class="data-input"
        name="name"
        placeholder="Name..."
        required>
    <input type="email"
        class="data-input"
        name="email"
        placeholder="Email..."
        required>
    <input type="submit"
        value="Subscribe"
        class="button button-primary">
  </form>

<template type="amp-mustache"
        id="amp-template-id">
      {{my_variable}}
    </template>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
cvializcommented, Dec 15, 2017

I think the CSS selector was not well received, so we moved to an attribute instead, like

<form submit-success-template="id"></form>
<template type="amp-mustache" id="id"></template>

I was not sure what Dima meant by that, but if I had to imagine I would say that the amp-mustache extension would expose a render action that might take a data structure like the submit-success response and the id of a container optionally that would receive the rendered content.

<form on="submit-success:myTemplate.render(data=event.response, container='wow')">
</form>
<template type="amp-mustache" id="myTemplate"></template>
<div id="wow"></div>
0reactions
ampprojectbotcommented, Feb 12, 2018

This is a high priority issue but it hasn’t been updated in awhile. @danielrozenberg Do you have any updates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: <amp-form> - amp.dev
The amp-form extension allows you to create forms ( <form> ) to submit input fields ... by using the template's id as the...
Read more >
How to create AMP for Email forms in Salesforce Marketing ...
In order to capture and process the data sent from the AMP form, we'll need to create the following: A Data Extension to...
Read more >
AMP Form always showing submit-error, even on response ...
Even if I skip all handling of data sent and just write response with the code 200 as is said in AMP form...
Read more >
The tag 'FORM' requires including the 'amp-form' extension
That's also the case of FORM and INPUT elements, which can be only used if you include a script reference to the amp-form...
Read more >
Working with Angular 5 Template Reference Variables - ITNEXT
A template reference variable is often a reference to a DOM element within a template. It can also be a reference to an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found