Re: name= in forms

Oyvind Holm wrote:
> 
> When validating the following HTML source:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
> 
> <html lang="en">
>   <head>
>     <title>name= in forms</title>
>     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>   </head>
>   <body onLoad="document.userform.field2.focus()">
>     <h1>name= in forms</h1>
>     <form action="index.cgi" method="post" name="userform">
>       <p>Field 1: <input type="text" name="field1" size="20" tabindex="1">
>       <br>Field 2: <input type="text" name="field2" size="20" tabindex="2">
>       <br><input type="submit" value="Submit" tabindex="3">
>       <input type="reset" value="Clear fields">
>     </form>
>     <p><a href="http://validator.w3.org/check?uri=http%3A%2F%2F194.248.216.19%2Fbasnakk%2Fform.html;ss=;outline=">Validator</a>
>   </body>
> </html>
> 
> the validator responds with
> 
>     <form action="index.cgi" method="post" name="userform">
>                                                           ^
>     Error: there is no attribute "NAME"
> 
> But according to the definition, name= is allowed in FORM tags. 

HTML 4.0 does not include FORM/name. HTML 4.01 does.
Refer to list of changes [1].

 - Ian

[1] http://www.w3.org/TR/html40/appendix/changes.html#h-A.1.1.12


> Who's
> right, the definition or the validator? I have to use name= to focus
> the cursor on a specified field, and this error irritates me big time
> 
> If it's not allowed, is there any other (legal) way to force the
> browser to focus the cursor on a specified field, in this example
> "field2".
> 
> And while we're at it... Is there a way to let the user use the ENTER
> key to submit the form when using multiple text fields? Thought
> "tabindex" was the right thing to use, but at least Netscape (don't
> know about MSIE) does not react to it.
> 
> Greetings from Norway,
> Øyvind A. Holm
> 
> ===================================================================
> |OpenPGP: 0xAD19826C 2000-01-24 Oyvind A. Holm <sunny256@mail.com>|
> |Fingerprint: EAE5 DCA0 0626 5DAA 72F8  0435 2E2B E476 AD19 826C  |
> =========== 2 + 2 = 5 for extremely large values of 2. ============

-- 
Ian Jacobs (jacobs@w3.org)   http://www.w3.org/People/Jacobs
Tel:                         +1 831 457-2842
Cell:                        +1 917 450-8783

Received on Tuesday, 28 November 2000 09:30:04 UTC