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


-- 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">
   <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">

The example under section 17.4.2 correctly uses NAME attributes.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:15:44 UTC