Validation Problems

liunx

Guest
I am new to XHTML and have made a site. I tried to validate my XHTML page width W3C's validator, but got some errors. I am having trouble fixing them.<br />
<br />
I have a menu with links. I don't like the dotted outline, so I have:<br />
<br />
<a class="menuLink" href=http://www.webdeveloper.com/forum/archive/index.php/"contact.html" onFocus="this.blur();">Text</a><br />
<br />
The validator is saying that there is a problem with the event handler "onFocus".<br />
<br />
I also have a form with an "onSubmit" handler. This also gets errors.<br />
<br />
At the end of the form, of course, of close it with </form>. The validator is saying that the form isn't open and it generates an error.<br />
<br />
Also, throughout my XHTML page I have used <p>. This always generates an error.<br />
<br />
<br />
I want a valid page. Can someone please help me fix these problems?<!--content-->That's because the names of all of the event handlers are all lower case and always have been. It's only because HTML is case insensitive that you haven't noticed this before.<!--content-->Thanks Charles.<!--content-->Your welcome. But please note that I have several times received an upbraiding on this board for pointing out that onClick is problematic. <br />
<br />
As to you other issues, please post the URL. It sounds like you've got some major tree errors there.<!--content-->Without having the code tp look at, could your <p> problem be due to the fact that you don't have any, or enough </p> tags?<!--content-->I have included slide-show.html and contact.html since these pages generate the most errors. Here is slide-show.html:<!--content-->Here's the next file:<!--content--><?xml version="1.0" encoding="utf-8"?><br />
<br />
You can get rid of that line. It's technically isn't needed, and I believe IE has issues with it.<br />
<br />
You have a <p> tag before your <iframe> tag, but no closing </p> tag after it.<br />
<br />
Your inner table has both opening and closing <p> tags around it. Get rid of those and your slide-show page should validate.<br />
<br />
And speaking of nested tables.... :)<br />
<br />
I'll weed through the other file now.<!--content-->Ok I will start fixing slide-show.html.<!--content-->It's kind of hard to say just what's going on there. You have some unclosed P tags. Remember, the P element cannot contain block elements and I think that that is causing trouble. And your use of nested tables is bad, very bad. <br />
<br />
You should be using XHTML 1.0 strict or XHTML 1.1 and you ought never to be using tables for layout.<!--content-->Slide-show is now valid! Thanks spufi.<!--content-->For your contact page, your form tag is incorrect. You coded the opening tag like it's an empty tag and then you included the closing tag. Change the opening tag to where it's just an opening tag.<!--content-->Originally posted by Charles <br />
It's kind of hard to say just what's going on there. You have some unclosed P tags. Remember, the P element cannot contain block elements and I think that that is causing trouble. And your use of nested tables is bad, very bad. <br />
<br />
You should be using XHTML 1.0 strict or XHTML 1.1 and you ought never to be using tables for layout. <br />
<br />
I will work on the <p> tags.<br />
<br />
What is wrong with using tables for layout? The reason I am using them, is because my menu is a div and my main content is within a div. Since div's are blocklevel, there would be the menu, then at the bottom would the main content begin. I tried changing the div's block level by adding display:inline; but that didn't work. So I decided to use tables. I can use the divs with the tables and everything looks fine. How would I keep the page looking the same without using tables?<!--content-->Thanks Charles and Spufi. My whole page is valid EXCEPT for one page. When I go to validate it, it says that the validator can't validate it because the page contains characters which don't correspond with its character encoding or something like that. I can't understand what could be causing this error so maybe you could help.<!--content-->Originally posted by Zach Elfers <br />
What is wrong with using tables for layout?From the HTML 4.01 Specification<br />
Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.If you want to see how it's properly done then take a look at Mr. Rick Bull's admirable site at <!-- m --><a class="postlink" href="http://www.rickbull.co.uk/">http://www.rickbull.co.uk/</a><!-- m -->. There is much there to emulate.<!--content-->I have a feeling I know why this page doesn't validate. Put this <meta> tag in for the charset. You should have one on every page. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Since I got rid of the <xml> tag on your one page it had the charset defined in it. Second, this is were Mozilla rocks over IE. Maybe Netscape does this too, but what you need to do is retype in your apostrophes. In Mozilla, the browser makes it obvious where these changes need to be made.<!--content-->Ok. I didn't have that tag added because I assumed that the <xml> tag would take care of it. Should I get rid of the XML tag and just use the meta tag, or should I add both?<!--content-->I see what you mean about the single quotes. They are appearing as ? marks.<!--content-->I believe IE has issues with the <xml> tag which contains your charset definition. <?xml version="1.0" encoding="utf-8"?> When you get rid of it, you'll need to define it elsewhere. Doing it in the <meta> covers it. So you only need it in the <meta> tag and not in both places.<!--content-->I used both tags. Now it validates, but with errors. I am working on it. Thanks for all your help! This is my first XHTML page, so next time I will know how to fix most errors when I validate it.<!--content-->All my pages are valid. I am not having any trouble anymore. I fixed the blurbs page.<!--content-->It cannot validate because you have curly quotes Elfers?which is not UTF-8 in that state kill the curly quotes and use notepad to do ' not ?<!--content-->It's already fixed. I used & + rsquo; to make my quotes. I should have noticed that. I copy and pasted those paragraph's from the publishers page where the blurbs were (they were also on the back of the book but it was faster through the publishers page). It's such an obvious mistake.:D<!--content-->Originally posted by spufi <br />
I believe IE has issues with the <xml> tag which contains your charset definition. <?xml version="1.0" encoding="utf-8"?> When you get rid of it, you'll need to define it elsewhere. <br />
<br />
For compability with older browsers, as long as you are sending the file a mimetype text/html you will always* need the metatag.<br />
If you are sending the file as a real XML page old browsers (including IE 6) can't read the page at all anyway, so then the meta is not needed anymore :D<br />
<br />
* = unless you got access to the server and can specify it in the HTTP heading<!--content-->
 
Back
Top