0

I am new to AMP for Email and I am trying to create some interactive forms to be send as Email to my customers. Now I am facing an issue in the linked drop down implementation in AMP for Email. My requirement is based on the country drop down selection I have to fill the city drop down for my users to select their city.
But as per the documentation in <amp-list>
Binding to the [src] attribute is not allowed.
So how can I do my linked drop down functionalities in my amp for email

Please suggest!

tadman
  • 208,517
  • 23
  • 234
  • 262
Mano
  • 1,109
  • 2
  • 10
  • 12

1 Answers1

0

One solution is to use amp-form instead of amp-list and bind to a hidden input element:

<form id="myForm" method="post" action-xhr="https://example.com">
  <input type="hidden" name="param" value="" [value]="state.param">
  <div submit-success>
    <template type="amp-mustache">
      <!-- your server response template -->
    </template>
  </div>
</form>

<button on="tap:AMP.setState({ state: { param: 'hello' } }), myForm.submit">Bind</button>

Also see the Advanced Server Request example on amp.dev: it demonstrates how you can replace an amp-list with an amp-form seamlessly on user interaction.

fstanis
  • 5,234
  • 1
  • 23
  • 42