Madge
December 11th, 2002, 09:05 PM
I have just validated my first two pages (ever) against XHTML 1.0 Transitional (fanfare! fireworks!).
After correcting two zillion nonconformances I am left with the same single error on each.
"onClick is not a valid attribute of the this element."
The immediate container is the a (anchor) element. This is then contained within td within tr within table within body. (I use onClick to summon up a popup window).
On rechecking the W3C specification this clearly allows onClick to be contained within any of the above elements and does not disallow any of them (crosschecking in the other direction against where onClick can be contained), so I am puzzled.
The other funny thing is that it only lists the first occurrence. Where I missed the closing tag out of my img elements it patiently listed each and every occurrence, and the same for missing alt tags, but in this case it prohibits my first usage and ignores subsequent identical usages. Is this typical validator behaviour?
I tested against the W3C validator and also Liam Quinn's WDG Validator with identical results. (Are they based on the same engine? is there any point in trying both?)
Any clues?
p.s. One page was validated against Transitional and the other against Frameset.
My code was in this format on both pages:
<td><a href="explorer.htm" onClick="openPopup()" target="smallpopup"><img src="images\msie.gif" alt="MSIE icon" height="32" width="32" border="0" /></a></td>
and the error warning was:
Error: there is no attribute onClick for this element (in this HTML version)
After correcting two zillion nonconformances I am left with the same single error on each.
"onClick is not a valid attribute of the this element."
The immediate container is the a (anchor) element. This is then contained within td within tr within table within body. (I use onClick to summon up a popup window).
On rechecking the W3C specification this clearly allows onClick to be contained within any of the above elements and does not disallow any of them (crosschecking in the other direction against where onClick can be contained), so I am puzzled.
The other funny thing is that it only lists the first occurrence. Where I missed the closing tag out of my img elements it patiently listed each and every occurrence, and the same for missing alt tags, but in this case it prohibits my first usage and ignores subsequent identical usages. Is this typical validator behaviour?
I tested against the W3C validator and also Liam Quinn's WDG Validator with identical results. (Are they based on the same engine? is there any point in trying both?)
Any clues?
p.s. One page was validated against Transitional and the other against Frameset.
My code was in this format on both pages:
<td><a href="explorer.htm" onClick="openPopup()" target="smallpopup"><img src="images\msie.gif" alt="MSIE icon" height="32" width="32" border="0" /></a></td>
and the error warning was:
Error: there is no attribute onClick for this element (in this HTML version)