Search code examples
formsamp-html

Is there a way to add AMP list in AMP forms in "submit-success"?


I want to add listings on AMP form submit but I am not sure if there is a way to do it.

Need help in this.


Solution

  • You can render dynamic HTML in your form response:

    <form method="post"
      action-xhr="/submit"
      target="_top">
      ...
      <div submit-success>
        <template type="amp-mustache">
          Hello {{name}}!
        </template>
      </div>
    </form>
    

    See the live example here.