Andrew Keyes on 27 Sep 2011 15:31:02 -0700


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

Re: [PLUG] HTML Validator


HTML 4.01 strict (Why not skip ahead to 5?) requires elements, like input, to be in a block level tag (examples listed in your email). The easy solution would be to put a blank <div></div> around your input.

On Tue, Sep 27, 2011 at 18:00, Casey Bralla <MailList@nerdworld.org> wrote:

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

http://validator.w3.org/

Â

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

http://www.NerdWorld.org


___________________________________________________________________________
Philadelphia Linux Users Group     --    Âhttp://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion Â-- Â http://lists.phillylinux.org/mailman/listinfo/plug


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug