Allow password (and other) input type in amp-form
What's the issue?
amp-form does not currently allow type="password" for input fields. Preventing any sort of secure text field entry for forms.
This is a fairly common feature of forms and shouldn't effect performance at all. There has never been an official response as to why it was disallowed in the first place as seen in https://github.com/ampproject/amphtml/issues/3348
It would be good to see an open discussion on revising the validation rules.
I think type=button also allow in input elements.
/to @cvializ @ericlindley-g
Login flows were a non-goal of the original amp-form implementation. Theoretically there is no reason why we cannot allow password fields in an amp form, but it will take careful security review and possibly some restrictions around which kinds of action URLs are allowed to receive password data.
Other input types that would be valuable include type="tel", type="number", type="email", etc. These activate different (more appropriate) keyboards on mobile phones, which is often a better user experience. (see Mobile Input Types for ref.)
One specific use case would be a Quantity field in ecommerce. Typically we'd set the input type to input="tel" to activate a number keypad. However, with the current type="text" input restriction, an AMP ecommerce user would tap the Quantity field, which activates an alpha keyboard, then the user has to toggle over to the numbers and symbols keyboard before typing in an updated quantity using the tiny numbers across the top of the numbers and symbols keyboard. Not the best. ☹️
@joshcp Those should be whitelisted already. If they aren't that should be changed.
Password is a different deal. It won't generally work well in AMP (because of autofill being an origin property) and we need to at least consider phishing risk.
Clarifying: This is implemented as a blacklist https://github.com/ampproject/amphtml/blob/master/validator/validator-main.protoascii#L2886
@joshcp So all those are allowed.
@cramforce Will the password input be implemented in the future? We are currently (mis)using the input type text for password for our freemium model, e.g. https://www.shz.de/sport/fussball/kopf-hoch-dino-so-wurschtelt-sich-der-hsv-in-die-relegation-id19250156-amp.html
@mario-lorenzen I'd say: Yes, it will be. Just subject to prioritization of the work.