输入标签内的HTML Name属性允许使用哪些字符? [英] What characters are allowed in the HTML Name attribute inside input tag?

查看:139
本文介绍了输入标签内的HTML Name属性允许使用哪些字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP脚本,它会动态生成< input> s,所以我想知道是否需要过滤姓名属性。



我知道名称必须以字母开头,但我不知道任何其他规则。我想方括号必须被允许,因为PHP使用这些来从表单数据创建数组。圆括号怎么样?空格?

解决方案

只有在表单控件名称中出现字符时,才能真正限制使用GET

get方法将表单数据集值限制为ASCII字符。 参考资料



有一个很好的线程 here


I have a PHP script that will generate <input>s dynamically, so I was wondering if I needed to filter any characters in the name attribute.

I know that the name has to start with a letter, but I don't know any other rules. I figure square brackets must be allowed, since PHP uses these to create arrays from form data. How about parentheses? Spaces?

解决方案

The only real restriction on what characters can appear in form control names is when a form is submitted with GET

"The "get" method restricts form data set values to ASCII characters." reference

There's a good thread on it here.

这篇关于输入标签内的HTML Name属性允许使用哪些字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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