W3C home > Mailing lists > Public > www-html@w3.org > January 2003

Re: Form controls outside of form blocks

From: C.Bottelier <c.bottelier@ITsec.nl>
Date: Fri, 17 Jan 2003 09:28:57 +0100
Message-ID: <3E27BEC9.FD6D34AD@ITsec.nl>
To: Shaddy Baddah <Shaddy_Baddah@hotmail.com>
CC: www-html@w3.org

Shaddy Baddah wrote:
> I am puzzled by the use of form controls outside of form blocks? Is it
> allowed? I have every reason to trust the strict DTD, and according to it,
> %formctrl entity is an item of the %inline entity. This means that an
> element of the %formctrl entity, say the INPUT element, can form the content
> of a number of elements other than FORM, say a P (paragraph element).

I recently reviewed a website hat had its form input outside of the

<form name="frm1" method="post" onSubmit="callservlet("/foobar"); return
  <input type="hidden" name="foo">
<input name="bar">

<form name="frm2" method="post" onSubmit="callservlet("/foobar"); return
  <input type="text" name="foo">

<a href="#" onClick="callservlet("/foobar"); return false;">
 <img src="ok.gif" bordr=0>

Alot is wrong with this code, not only did they have some of the form
outside the form, but they also use Javasript to script standadr HTML
in a non standard way.

What the callservlet function does is to copy the value of "foo" in
"frm2" to
the hidden "foo" of "frm1", check the values of "fo" and "bar" of
and then submit "frm1" to the given URL. Their code actually is able
"bar" its value by accessing "frm1" This is strange since technically
the "bar"
input has no relation other to "frm1" than that it is defined after
Current browsers (tested with IE5, IE6, Mozilla 1.2) seem to remember
the last
declared form and assign it as the parent of any following stray input.

It is a bit strange that the HTML4.01 DOM allows an form input to be of
inline. (I haven't check upon this.) The only reason for this (as far as
I can come up with currently) is that it is intended to be used for some
purpose. Say declae an checkbox somewhere in a document that is not
to be posted but only to be used as user input for a script.

Received on Friday, 17 January 2003 03:29:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:02 UTC