PDA

View Full Version : HTML validation fails



cardioid
09-01-2013, 10:19 PM
1) Script Title: All levels menu generator

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/ddlevelsmenu/generator.htm

3) Describe problem: This line fails the W3C validator:

<validator output>
Bad value ddsubmenu1 for attribute rel on element a: The string ddsubmenu1 is not a registered keyword or absolute URL.

<li><a href="/dev/index.shtml" rel="ddsubmenu1">Products</a></li>

Syntax of link type valid for <a> and <area>:
A whitespace-separated list of link types, with no duplicate keywords in the list. Each link type must be listed as allowed on <a> and <area> in the HTML specification, or must be listed as allowed on <a> and <area> on the Microformats wiki, or must be an absolute URL. You can register link types on the Microformats wiki yourself.
</validator output>

Perhaps one way would be to change the offending link to an absolute URL, but I don't know how to do that. I'm using an SSI for this section, so I can reuse it on every page.

Btw, the lines that don't have submenus validate fine.

Any help appreciated!

Thanks,
cardioid

molendijk
09-01-2013, 11:39 PM
What exactly do you want to be validated? The results of the wizard or the wizard itself (for which http://validator.w3.org gives 54 errors!)?

traq
09-02-2013, 01:46 AM
Arbitrary (e.g., "ddsubmenu") values aren't technically valid on the rel attribute. There are two possible solutions:

1) If you're validating against HTML5, you can rewrite the markup (and the script) to use a data- attribute instead - i.e., data-ddsubmenu.

2) Ignore it - while technically invalid, this won't cause any problems at all in any modern browser.

cardioid
09-02-2013, 04:22 PM
2) Ignore it - while technically invalid, this won't cause any problems at all in any modern browser.

Sounds good to me. Thanks for the reassurance.

cardioid

cardioid
09-02-2013, 04:25 PM
What exactly do you want to be validated? The results of the wizard or the wizard itself (for which http://validator.w3.org gives 54 errors!)?

I meant the downloaded code, but, as Traq pointed out, it doesn't appear to be necessary to validate that. Some things don't work in my layout and I'm trying to find the problem. As there were many references to that submenu thing, I thought that this may be the culprit.

Thanks,
cardioid