在这种情况下,不允许使用自动填充字段名称“邮政编码”

im目前正在尝试优化我的网页上的表单。 HTML验证程序给我以下错误:

 The autofill field name “postal-code” is not allowed in this context.  

我不知道为什么,因为它做了应该做的事。自动填充会插入邮政编码。这是元素:

<td><input type=number name="changeZip" min=00000 max=99999 autocomplete="postal-code"></td>

此元素具有相同的错误:

<input class="login" type="number" name="txtZip" value="" required max="99999" min="00000" placeholder="Postleitzahl" autocomplete="postal-code"/>

为什么根据错误消息在这里不允许?我在Google上找不到任何东西。

谢谢。

y4328978 回答:在这种情况下,不允许使用自动填充字段名称“邮政编码”

type属性必须为“文本”。一些国家的邮政编码使用字母和数字的组合。

因此,您的输入元素应为

<input type="text" name="changeZip" minLength="5" maxLength="5" autocomplete="postal-code">
本文链接:https://www.f2er.com/1330337.html

大家都在问