Click here to get back home

Why is this page invalid?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Why is this page invalid? mark4asp 06-25-2007
Posted by mark4asp on June 25, 2007, 1:30 pm
Please log in for more thread options


Why is this page invalid?

Pasted into http://validator.w3.org/ I'm told that the page is
invalid. Why? It flags problems with the <body> and </html> tags but
I can't see why. Is the W3C validator broke is or it my page? If it's
my page then what's wrong with it?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://
www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>my page - Login</title>
<link href="images/login.css" rel="stylesheet" type="text/css">
<script src="javascript/browser.js" type="text/javascript"></script>
</head>

<body>

<!--start header - contains my page logo-->
<div id="header">
<span>A Logo</span><span id="nav">Home | <a
href="contact.aspx">Contact</a></span>
</div>
<!--end header-->

<!--start login - contains login box and photo-->
<div id="login">

<form method="post" id="frmMain" action="Default.aspx">
<div id="divMain">
<p class="subLogin">Subscriber Login</p>
<p><label for="txtUserName">User Name</label><br>
<input class="mwInput" size="16" name="txtUserName" id="txtUserName"
type="text" title="Please enter text (do not cut and paste)"><br></p>

<p><label for="txtAccessCode">Access Code</label><br>
<input class="mwInput" size="16" name="txtAccessCode"
id="txtAccessCode"
onkeypress="if(event.keyCode==13)validateLoginDetails();"
type="password" title="Please enter User and Access codes using
correct letter case."></p>

<div id="loginButton"><a id="loginButtonA"
href="javascript:validateLoginDetails();"> LOGIN </a></div>

<p id="ForgotPWD"><a href="contact.aspx?
Action=ForgotPassword">Forgot Password</a></p>
</div>
</form>

<img id="mainphoto" src="images/hd_photo.jpg" width="520" height="260"
alt="two businessmen at a meeting"></div>
<!--end login-->

<!--start tickertape-->
<div id="tickertape">
<iframe marginwidth="0" src="tickertape.aspx" marginheight="0"
frameborder="0" height="17" scrolling="no" width="750"></iframe>
</div>
<!--end tickertape-->

<!--start main div - contains left and right columns and footer and
centres content on the screen-->
<div id="main">

<!--start col1 - this is the lefthand column (services)-->
<div id="col1">
<h3>Subscriptions</h3>
<h3>Services</h3>
<h4>Newswire &amp; Database</h4>
<h4>Watch</h4>
<p>&nbsp;</p>
<h4> Analysis</h4>
</div>
<!--end col1 column-->

<!--start col2 - this is the righthand column (welcome, etc.).
Placed first in html code for SEO.
CSS 'float' property is used to switch column position for layout
purposes-->
<div id="col2">

<div class="col2cont1">
<h3>
Some content</h3>
</div>

<div class="col2cont1">
<h3>
Some more content</h3>
</div>
<div class="col2cont2">&nbsp;</div>
</div>

<!--end col2 column-->

<!--start footer-->
<div id="footer">
<p>A footer<a href="http://www.mypage.com"></a></p>
</div>
<!--end footer-->

</div>
<!--end main div-->

</body>
</html>


Posted by Scott Bryce on June 25, 2007, 1:55 pm
Please log in for more thread options


mark4asp wrote:

> Why is this page invalid?

<html snipped>

You are using a frameset doctype on a page that is not a frameset.

Change the doctype to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Then it will validate.



Posted by Beauregard T. Shagnasty on June 25, 2007, 3:04 pm
Please log in for more thread options


Scott Bryce wrote:

> mark4asp wrote:
>> Why is this page invalid?
>
> <html snipped>
>
> You are using a frameset doctype on a page that is not a frameset.
>
> Change the doctype to
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">

..or better yet, HTML Strict - for new documents. Use Transitional only
if you are .. well .. transitioning legacy documents.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

> Then it will validate.

..and whether the page validates with either, will depend solely on the
lack of errors. <g>

--
-bts
-Motorcycles defy gravity; cars just suck

Posted by Scott Bryce on June 25, 2007, 3:49 pm
Please log in for more thread options


Beauregard T. Shagnasty wrote:

> ..and whether the page validates with either, will depend solely on
> the lack of errors. <g>

I tried validating it as HTML 4.01 strict, and there were errors. I
tried as HTML 4.01 transitional, and it validated.

Using an HTML 4.01 strict doctype and correcting the errors would be
preferred, but using an HTML 4.01 transitional doctype will work for the
page in question.

Posted by mark4asp on June 26, 2007, 4:06 am
Please log in for more thread options


On Mon, 25 Jun 2007 19:04:13 GMT, "Beauregard T. Shagnasty"

>Scott Bryce wrote:
>
>> mark4asp wrote:
>>> Why is this page invalid?
>>
>> <html snipped>
>>
>> You are using a frameset doctype on a page that is not a frameset.
>>
>> Change the doctype to
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>> "http://www.w3.org/TR/html4/loose.dtd">
>
>..or better yet, HTML Strict - for new documents. Use Transitional only
>if you are .. well .. transitioning legacy documents.
>
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
>
>> Then it will validate.
>
>..and whether the page validates with either, will depend solely on the
>lack of errors. <g>

The page cannot be HTML 4.01 strict because it has an iframe. I suppose
that means there is no legal syntax for iframes because I agree with
Beauregard that transitional is not much use. I guess I will have to
drop that iframe if I want my stuff to be valid HTML 4.01 strict.

Which is a real shame because iframes are so very useful for AJAX but I
should try replacing it with an object.

Similar ThreadsPosted
Missing entitites - Invalid or not well-formed ? October 15, 2004, 3:15 am
Document seems invalid, but validates as HTML 4.01 strict September 4, 2008, 3:01 pm
W3C HTML Validator Error - Invalid content-type November 13, 2004, 1:48 am
Re: is invalid html 4 strict? June 21, 2008, 1:43 pm
Re: is invalid html 4 strict? June 21, 2008, 6:15 pm
Need help creating a "Click absolutely ANYWHERE on this page" link for an HTML page with no content February 7, 2007, 5:40 pm
Activating parent page link from 'child page' - revised June 3, 2005, 11:30 am
referencing the index.html page from another page in the same directory July 26, 2004, 12:48 am
extract page structure from page source? September 19, 2006, 1:46 pm
how to make a link to an old page go to a new page without displaying anything August 20, 2007, 3:08 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap