bad first example on FORM page

On this page describing Forms --

http://www.w3.org/TR/html4/interact/forms.html#submit-format

-- the first simple example contains an error which caused me much grief. The two "INPUT" elements include "id" attributes. This is a mistake; "id" is not a normal attribute for INPUT elements; instead they should be "name". Here is the exact text (with my comments on the offending lines):

<FORM action="http://somesite.com/prog/adduser" method="post">
   <P>
   <LABEL for="firstname">First name: </LABEL>
             <INPUT type="text" id="firstname"><BR>   // should be: name="firstname"
   <LABEL for="lastname">Last name: </LABEL>
             <INPUT type="text" id="lastname"><BR>    // should be: name="lastname"
   <LABEL for="email">email: </LABEL>
             <INPUT type="text" id="email"><BR>
   <INPUT type="radio" name="sex" value="Male"> Male<BR>
   <INPUT type="radio" name="sex" value="Female"> Female<BR>
   <INPUT type="submit" value="Send"> <INPUT type="reset">
   </P>
</FORM>


The example under section 17.4.2 correctly uses NAME attributes.

Tom

Received on Wednesday, 25 January 2012 13:09:21 UTC