Help - Search - Members - Calendar
Full Version: Help with a validation error.
Invision Power Services > Community Forums > Community Web Design and Coding
IAIHMB
When trying to create a rollover with JavaScript in an XHTML 1.1 file, the W3 validator doesn't like the fact that i've used the name attribute. The validation results can be found here:

http://validator.w3.org/check?uri=http%3A%...a.com%2Fpaul%2F

The strange thing is, i've used the name attribute 4 times if I remember correctly, yet they only consider it an error once. Are JavaScript errors parsed the same way as JavaScript is? Anyways, thanks a lot for any help, it's appreciated. :">
_
'name' is removed from non-form elements in the XHTML 2.0 draft, probably in XHTML 1.1 as well.
Michael Boutros
Try using 'id' rather than 'name.'
IAIHMB
I'll give it a shot, thanks alot! I guess that's what I get for purchasing an old JavaScript book. tongue.gif
Michael Boutros
Good luck original.gif
IAIHMB
It worked, partially. Internet Explorer no longer renders the rollover, but i'm assuming we are on the right track. ermm.gif
Michael Boutros
[Begin: Very Anti-IE Me] Well, they should be using FireFox, let em suffer so they have to get it! Muhahahahahhahahahah! [End]

Sorry, I have no idea, I just read that id and name thing when I was reading about HTML forms.
IAIHMB
Yeah, after a bit of research it seems that Internet Explorer's poor support for XHTML is at fault. I suppose I will just use JavaScript to determine which browser the viewer is using and then have it replace the faulty code with the valid code if they are using any other browser. After all, if they are using Internet Explorer, I doubt they care about standards. tongue.gif
Michael K.
Use document.getElementById('forumButton') instead of document.forumButton. original.gif
IAIHMB
Oh, oh, we are half way there now! tongue.gif In Internet Explorer, the rollovers appear, they just don't go away.

Edit: Doh, I only replaced it once. Thanks a lot for the help! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.