W3C home > Mailing lists > Public > site-comments@w3.org > January 2012

bad first example on FORM page

From: Tom McDougal <tfmcdougal@gmail.com>
Date: Wed, 25 Jan 2012 08:23:34 +0000
Message-Id: <8434FD36-9B3E-4B44-8ECE-C6D29F71D34C@gmail.com>
To: site-comments@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 24 October 2012 16:21:34 GMT