Amphtml: amp-list strips out <form> elements

Created on 7 Jun 2017  路  11Comments  路  Source: ampproject/amphtml

I'm trying to create an amp-list where each item contains a form.

Unfortunately the form is getting stripped out.

Example:
https://edhollinghurst.com/amp-list/amp-list.html

High Priority Feature Request

Most helpful comment

@danielrozenberg is going to take this on. 馃帀

All 11 comments

@edhollinghurst Currently they are not whitelisted to be used by amp-mustache templates.

@cvializ disallowing form elements in templates probably predates forms support. We should look into enabling them. Important part is ensuring same validation rules are applied on the client side when they are removed from the blacklist in sanitizer.js.

/cc @ericlindley-g

/cc @choumx @zhangsu

7434 fixed this issue for amp-live-list. We can probably apply a similar fix for amp-list (dispatch AmpEvents.DOM_UPDATE on render).

The form tag is stripped by src/santizer.js. Any template tags in the form will also be stripped by the sanitizer. We could allow forms in the sanitizer, but unfortunately any submit-success or submit-error templates would also be stripped. We might want to have this issue blocked until #7118 is fixed so forms can reference templates by id.

Bumping priority since this will be blocking soon for a dynamic content project.

@cvializ Let me know if your plate is super full. 馃槃

@danielrozenberg is going to take this on. 馃帀

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

@danielrozenberg Do you have any updates ? I am also facing same problem. is there any hackyfix for this ?

@dev-drprasad working on it! This is blocked by two other issues (#7118 and #12670,) we're estimating all of these to be resolved by end of January

@aghassemi, just curious: was the solution to this problem not actually blocked by #7118 and #12670 as @danielrozenberg mentioned in the comment above? Or can we expect solutions for #7118 and #12670 to be merged soon now that we can embed form elements into templates?

@radiovisual it turns out that #7118 was _not_ a blocker, but it's closely related. I'll be merging #12670 soon, which would enable you to reference templates by ID instead of nesting templates (see the example provided in #12670), however there's nothing stopping you from using forms in templates and nested templates in templates now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

choumx picture choumx  路  3Comments

torch2424 picture torch2424  路  3Comments

cvializ picture cvializ  路  3Comments

samanthamorco picture samanthamorco  路  3Comments

radiovisual picture radiovisual  路  3Comments