如果输入标签没有名称,表单数据是否仍然传输? [英] Does form data still transfer if the input tag has no name?

查看:90
本文介绍了如果输入标签没有名称,表单数据是否仍然传输?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了提高效率,我想知道如果您省略name属性或将其设置为null,textarea中的文件或文本仍然会传输到服务器。例如

For efficiency purposes I am wondering if a file or text in a textarea still gets transferred to the server if you omit the name attribute or set it to null. eg

<input type="file" id="file" name="">
<textarea id="text" name="">

我注意到数据在服务器上不可用,如果您这样做的话。

I notice that the data is not available at the server if you do this.

推荐答案

如果我理解正确,W3C规范要求每个表单输入元素都有一个名称指定的属性。否则,该元素将不会被处理。 来源

The W3C specification, if I understand it correctly, mandates that every form input element has a name attribute specified. Otherwise that element will not be processed. Source

这篇关于如果输入标签没有名称,表单数据是否仍然传输?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆