Forum Moderators: open
<div id="header">
<form id="search" method="post" action="search.php">
<input id="term" type="text" />
<input type="submit" value="Search" />
</form>
</div>
The markup validator in Dreamweaver doesn't show any errors. More precisely, why is it not good, or why is it wrong to have a nested form within a div?
The only way around it, as far as I know, is to place the opening tag for form before the first div. However, this method looks overly complicated to me.
<form id="search" method="post" action="search.php">
<div id="header">
<input id="term" type="text" />
<input type="submit" value="Search" />
</div>
</form>
Thanks for any help
[pmachine.com...]
Forms can be wrapped in <fieldset> </fieldset> tags, and in this manner the page will validate.
Thanks for the reply. I usually code in XHTML transitional, that's why I never ran into this problem.
However, I'm not so sure if it's really a bug. It seems that several designers either use fieldset or paragraph tags to enclose input types.
The paragraph method I found on serveral sites listed at www.stylegala.com. They are quite strict about standards in general.
I'll see if I can find out more about it.
<!ELEMENT FORM - - (%block;¦SCRIPT)+ -(FORM)>
[w3.org...]
The (%block;¦SCRIPT) means a form can contain a block element or a script element as its children. &formctrl; elements (INPUT ¦ SELECT ¦ TEXTAREA ¦ LABEL ¦ BUTTON) are inline, so you need a table, fieldset/legend, div or similar between the form and the form elements.
Not a bug in the validator/parser/spec.
The markup validator in Dreamweaver doesn't show any errors.
I'm using HTML 4.01 Trans. Standard DW framesets do not validate. It doesn't detect missing ALT attributes or unencoded '&' chars is urls, and it flags a missing HREF in a <BASE> tag as an error. It also dislikes 0 as a value for <IFRAME> margins (bizarrely, it is correct here but W3C is ok with 0). There are other bugs too - like when converting tags to lower case, it changes all attribute values, including urls, events, values, etc. thereby breaking code and/or changing the rendered page.
DW is a great program, but it is buggy. For instance, when editing a templated page, if you leave off a closing attribute quote you've got problems.
The built-in validator in DW is useful, but not definitive.
Kaled.