XHTML: Invalid form tag placement

Hi folks,

Yet another XHTML validation snafu on the road to spiritual creaminess...

I'm sure that I'm not the only designer out there who has discovered that opening <form> and closing </form> tags have a nasty habit of adding vertical space. This is especially difficult to deal with when the form has been carefully constructed within a table for layout purposes (CSS2 pie-in-the-sky capabilities notwithstanding...).

My trusty workaround to this predictable HTML snafu has been to open <form> and </form> tags *outside* of a table's structure (or at least far away from the delicate layout elements), either between </td><form></td> or between </tr><form><tr>. This has worked like a charm in the past, but unsurprisingly the XHTML validator will have none of it.

However, to my dismay I discovered that even if the opening <form> and closing </form> tags appear "properly" in cells above or below the form fields, the validator will *still* identify these as invalid:

  1.. Line 38, column 66: start tag was here (explain...). 
  ..." valign="middle" class="normalbold"><form name="search" id="search
                                          ^
  2.. Line 49, column 130: end tag for element "form" which is not open (explain...). 
  ...submit" name="go" value="go" /></form></td>

ie: The opening and closing form tags from lines 1 and 2 are in different cells, which it finds unacceptable.

Does the XHTML validator honestly expect an entire block-level form to appear within a single table cell, or none at all to be considered valid? Or am I just missing something horribly obvious?


Thanks in advance.

Emlyn


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Emlyn Addison
Director of Creative Services
www.RI.gov -  Rhode Island Government Online
401.831.8099 x24

Received on Wednesday, 5 November 2003 16:27:05 UTC