我有一个名称为MD5字符串的输入字段,例如:
< input type =hiddenname =7815696ecbf1c96e6894b779456d330e现在我明白,将数字作为输入字段名称中的第一个字母通常是不好的做法,但有没有任何副作用,如某些浏览器不会发送POST请求?
解决方案ID属性必须以HTML 4.01 W3C规范的字母开头,但是由于输入元素的NAME属性是CDATA类型的(
对NAME属性的一个真正限制是当您使用GET方法提交表单时,因为在这种情况下,表单数据必须限制为ASCII码(来源)。
I have an input field whose name is an MD5 string e.g.:
<input type="hidden" name="7815696ecbf1c96e6894b779456d330e" value="1">
Now I understand that having a number as the first letter in an input field name is generally bad practice, but are there any side-effects to this such as a certain browser won't send it in the POST request?
解决方案An ID attribute would have had to begin with a letter as per the HTML 4.01 W3C specification, however since the NAME attribute of input elements is of CDATA type (Source), this restriction does not apply.
One real restriction you get on NAME attributes is when you submit a form with the GET method, because in this case, form data must be restricted to ASCII codes (Source).
更多推荐
输入字段名称以数字开头
发布评论