Hi
I have a validation problem with a form and nested divs. I understand what
the problem is, but I don't see how to fix it. This is my normal page
structure, and it validates:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
<div>
</div>
<div>
<div>
<form name="form1" action="">
<p>Some form elements</p>
</form>
</div>
<div>
<form name="form2" action="">
<p>Some form elements</p>
</form>
</div>
</div>
</body>
</html>
Now the form has some additional elements in the first div:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
<div>
<form name="form1" action="">
<p>Some form elements</p>
</div>
<div>
<div>
<p>Some more form elements</p>
</form>
</div>
<div>
<form name="form2" action="">
<p>Some form elements</p>
</form>
</div>
</div>
</body>
</html>
And due to improper nesting this does not validate. I tried the same thing
with a layout table, it does not validate either (neither in strict nor in
transitional mode). Note that form 2 is the reason why I can't span the form
over the whole body, which would make it validate without a problem.
Now in the early days I learnt that forms could begin and end inside or
outside any element, regardless of the layout or table structure. Is this
just outdated, or is there a possibility to declare a form as cross-element?
--
Markus