Path: news.cs.hut.fi!not-for-mail From: Jukka.Korpela@hut.fi (Jukka Korpela) Newsgroups: comp.infosystems.www.authoring.html Subject: Re: Case sensitive input names in IE! Date: Wed, 13 Dec 2000 08:00:34 GMT Organization: Helsinki Univ. of Technology Lines: 37 Message-ID: <3a372793.2504847610@news.cs.hut.fi> References: <9167f9$689$1@nnrp1.deja.com> NNTP-Posting-Host: yucca.hut.fi X-Trace: midnight.cs.hut.fi 976694318 285254 255.255.255.255 (13 Dec 2000 07:58:38 GMT) X-Complaints-To: abuse@niksula.cs.hut.fi NNTP-Posting-Date: 13 Dec 2000 07:58:38 GMT X-Newsreader: Forte Free Agent 1.21/32.243 Xref: news.cs.hut.fi comp.infosystems.www.authoring.html:323365 datastar@my-deja.com wrote: >I just discovered something rather shocking with MSIE... if a form >contains uppercase & lowercase versions of the same variable names - - >...when the form is submitted, data gets posted to my CGI script, but >only ONE variable gets posted (the second one). Moreover, radio buttons with, say, name="aaa" and name="AAA" act as a group, i.e. checking one of them unchecks the other. This looks like a bug, but it's actually correct behavior, and other browsers (e.g. Netscape, Opera, Lynx - at least the versions I tried) are in error. The specification says that the value of the NAME attribute is case insensitive: http://www.w3.org/TR/html4/interact/forms.html#adef-name-INPUT Note "[CI]" which refers to: "The value is case-insensitive (i.e., user agents interpret "a" and "A" as the same)." The HTML 3.2 specification doesn't seem to say anything about the case sensitivity of NAME values. (It mentions, en passant, that the value of NAME for MAP is case sensitive; HTML 4 says it's case insensitive. Note that NAME attributes have been declared with CDATA, so they are not names in the SGML sense, so no case sensitivity rules for them have been established in the DTDs.) The practical conclusion is apparently that an author should avoid using NAME attribute values that differ in case of letters only. It's probably safest to write form handlers without assuming that browsers even preserve the case of letters in them. The specification might be read as allowing to give (when checked) the contribution aAA=42 into the form data set! So it's better to perform any checks on field names case-insensitively in CGI scripts. -- Yucca, http://www.hut.fi/u/jkorpela/ De gustibus et coloribus non est disputandum.