ampproject / ampproject/amphtml
amp-form - render all submit-error and submit-success nodes of the form
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### 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:
```
{{#phone}}
Phone {{phone}}
{{/phone}}
{{#phone_duplicate}}
Phone number already exists.
{{/phone_duplicate}}
```
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_
Contributor guide
Research direction
Start at the amp-form entry point that handles submit-error and submit-success nodes, then trace how the first matching node is selected after a response. Verify the behavior with the provided form containing multiple nodes and confirm that every matching node is rendered when its response data applies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100