Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-form - render all submit-error and submit-success nodes of the form #37551

Open
fpattis opened this issue Feb 2, 2022 · 1 comment
Open

Comments

@fpattis
Copy link

fpattis commented Feb 2, 2022

Description

currently an amp-form only renders the first html node within the

tag that contains the attribute "submit-error".

it would be great if every node in the form with existing "submit-error" attribute could be rendered.

example:

 <form method="post" action-xhr="/order" enctype="application/x-www-form-urlencoded">

<div submit-error style="color: tomato;">
  <template type="amp-mustache">
    {{#phone}}
    Phone {{phone}}
    {{/phone}}
  </template>
</div>
<div submit-error style="color: tomato;">
  <template type="amp-mustache">
    {{#phone_duplicate}}
    Phone number already exists.
    {{/phone_duplicate}}
  </template>
</div>

</form>

In this example only the first node is ever considered after submit of the form and the second is never rendered, even if the error response contains both properties "phone_duplicate" and "phone" or only the second one "phone_duplicate".

Alternatives Considered

none

Additional Context

No response

@stale
Copy link

stale bot commented Apr 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants