tags:

views:

90

answers:

3

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?

+3  A: 

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).

Daniel Vassallo
The name attribute is of type CDATA and is not a SGML name token as far as I can tell.
Willis Blackburn
@Willis: You're right... I fixed my answer to make it more accurate.
Daniel Vassallo
+2  A: 

As far as I know, you shuould have no problem in any browser. But you can always consider to prepend some kind of string, also for convenience:

<input type="hidden" name="h.7815696ecbf1c96e6894b779456d330e" value="1">

Which can help someway.

Enrico Carlesso
+1  A: 

The HTML spec doesn't restrict the control name in any way. In fact it even says that the control name is URL-encoded and that spaces and non-alphanumeric characters are handled in a certain way, so obviously the designers anticipated names having an arbitrary format.

Willis Blackburn
+1 for the accurate observation.
Daniel Vassallo