Casey Bralla on 27 Sep 2011 15:00:35 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] HTML Validator

I've been working on a web-based project management system. To ensure the HTML code is error free, I've been using W3C's validator program


Unfortunately, I'm getting some strange error messages that I don't understand (not too surprising <grin>). I'm wondering if their validator is really telling me things I should know. For example, I have the statement:


<FORM name="dummybutton" action="" method="get"><INPUT type="submit" value="" title="" ></FORM>


[This is just a dummy placeholder for a menu selector that will appear on similar pages.]


The validator gives me this error message:


document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag

âybutton" action="" method="get"><INPUT type="submit" value="" title="" ></FORM> 


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").



Huh? When I changed to DOCTYPE 4.01 Transitional, the problem went away.


Anybody have experience with the validator? I wanted to be "strict" in my HTML, but I'm thinking I'm just asking for trouble. Any comments/suggestions from this group?



Casey Bralla

Chief Nerd in Residence


The NerdWorld Organisation

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --