Log in

View Full Version : Validating HTML for dropdown menu gives an error



paheto
02-12-2012, 11:54 AM
Hi html guru's,

I have struggled long time already with DD dropdown menu because when I am validating my site it gives me errors for dropdown not registered.

Example:

Line 38, Column 69: Bad value dropmenu1_d for attribute rel on element a: Keyword dropmenu1_d is not registered.
…t/purjeet.html" title="Purjeet" rel="dropmenu1_d"><span>Purjeet</span></a></li>Syntax of link type valid for <a> and <area>:
A whitespace-separated list of link types listed as allowed on <a> and <area> in the HTML specification or listed as an allowed on <a> and <area> on the Microformats wiki without duplicate keywords in the list. You can register link types on the Microformats wiki yourself.

I cannot find the reason. Please advise.

Best regards,
Paivi

jscheuer1
02-12-2012, 12:16 PM
It's a fine point. I wouldn't worry about it. In fact, last I checked this was only considered invalid for the new experimental HTML 5 validator. Are you using the HTML 5 DOCTYPE?

If it really bothers you and you're committed to the the HTML 5 DOCTYPE, the script could be edited to use a data-rel attribute instead of the rel attribute. All data- attributes are valid in HTML 5. However, detecting them in script requires either the javascript getAttribute() function or, if the script is jQuery based, the attr() function. There's a good chance the script already employs one of those. If so, just change all references to rel to data-rel, and use data-rel instead of rel in your HTML markup.

The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please post a link to the page on your site that contains the problematic code so we can check it out.

paheto
02-12-2012, 02:20 PM
Thanks for your quick reply. I have also read that it doesn't matter if you get a validating error for these dropdown lists but then I have another problem.

Maybe my folder structure is not correct then. I have used for the following stucture

<div id="glowmenu" class="glowingtabs">
<ul>
<li><a href="index.html" title="Etusivu"><span>Etusivu</span></a></li>
<li><a href="sails/sails.html" title="Purjeet" rel="dropmenu1_d"><span>Sails</span></a></li>

<div id="dropmenu1_d" class="dropmenudiv_d">
<a href="sails/rullagenoa.html">Rullagenoa</a>
<a href="sails/hartikgenoa.html">Hartik-genoa</a>
<a href="sails/isopurje.html">Isopurjeet</a>
<a href="sails/lapilatoitettu.html">L&auml;pilatoitetut isopurjeet</a>
<a href="sails/triradial.html">Triradial Racing -spinaakkeri</a>
<a href="sails/genaakkeri.html">Genaakkeri</a>
</div>

The problem is when I hit the first level e.g Sails the dropdown list for all the rests are not visible and I have to always go via Index to get it back. I have 4 dropdown lists.

I haven't publish the website yet because of this reason.

Best regards, Paivi

paheto
02-12-2012, 03:14 PM
Hi again,

I tried the data-rel for dropdown but now it seems that it doesn't work at all. Validating passed nicely :). Only the first level is working now. Don't get dropdown to visible at all....
Br, Paivi:confused:

jscheuer1
02-12-2012, 04:19 PM
I'd have to see the page(s). Put up a demo of the problem page(s) in a test area on your site. If there needs to be more than one page to show the problem, they can link to each other, but don't have to be linked to from other pages on your site. From what you're saying, at most you should only need two pages to show the problem.

About the data-rel solution, you probably missed something in the script. Easy to do as it might be hard to spot all of the references to rel in it. Or there could be another problem there. Again, I'd have to see the page(s).

paheto
02-13-2012, 05:09 PM
Hi John,
Thanks for you help! I found the error myself, wasn't very accurate with referring to .js file in my html.
I am using HTML5 and I just ignore the validating error because now it seems to working well.
Have a nice day.

Best regards,
Paivi