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?
Note, that not all characters are submitted for name
attributes of form fields (even when using POST)!
White-space characters are trimmed and inner white-space characters as well the character .
are replaced by _
.
(Tested in Chrome 23, Firefox 13 and Internet Explorer 9, all Win7.)