如果没有指定 name 属性,是否保证浏览器不会发送 input 元素?
例如,我们可以假设 POST 下面的表单不会发送信用卡号吗?
<form action="/process" method="post">
<input id="credit-card-number" type="text">
<input type="submit" name="commit" value="Go">
</form>
最佳答案
Is it guaranteed that a browser doesn't send an input element if it doesn't have the name attribute specified?
是的(除非你用 JavaScript 来改变它)。
规范很清楚controls without names cannot be successful .
A successful control must be defined within a FORM element and must have a control name.
关于html - 所有浏览器都会忽略无名输入字段吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12784696/