html - 所有浏览器都会忽略无名输入字段吗?

标签 html http-post forms input-field name-attribute

如果没有指定 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/

相关文章:

android - 如何在服务器上发送变量 float ?

javascript - 使用 Angular JS 和 Cordova 上传表单数据和图像

php - Laravel 表单方法 get - url 参数

html - 从移动设备查看时显示另一个页面

forms - HTML5 输入类型的范围和颜色不能为空。如果他们镜像的数据库列为空怎么办?

c - libcurl 从 HTTP 请求检索响应

php - 如何知道更新了哪些字段

java - java中的网页抓取和数据处理

html - CSS 背景 gif 图像不循环重复

Spring MVC @RequestParam对象列表