Validation Help - <Head>

ok - the code appears <!-- m --><a class="postlink" href="athttp://www.moneycare.com.au/Pages/initialpage.html">athttp://www.moneycare.com.au/Pages/initialpage.html</a><!-- m --> <br />
<br />
and I am trying to do the right things and validate it all.<br />
<br />
anywho - i am using this validator <!-- m --><a class="postlink" href="http://www.htmlhelp.com/tools/validator">http://www.htmlhelp.com/tools/validator</a><!-- m --> and getting this message:<br />
<br />
"Line 7, character 7: <br />
</head><br />
^<br />
Error: missing a required sub-element of HEAD"<br />
<br />
The top part of code is as follows:<br />
<br />
<br />
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
2 <br />
3 <html><br />
4 <br />
5 <head><br />
6 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><br />
7 </head><br />
<br />
<br />
can someone please explain this to me??<br />
<br />
<br />
THanks<!--content-->Assuming the validator is considering your page to HTML 4.01 it would seem you are missing the title tag.<br />
<br />
In HTML 4.01 <title> is a required element within the head tags.<br />
<br />
I hope that sorts your problem out.<!--content-->Also, strictly speaking, you should close all tags, even single tags. Admittedly this is for XHTML compatibility but it's good design practice anyway.<br />
<br />
As such, this:<br />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">should be this:<br />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252 /"><!--content-->Originally posted by entimp <br />
Assuming the validator is considering your page to HTML 4.01 it would seem you are missing the title tag.<br />
<br />
In HTML 4.01 <title> is a required element within the head tags.<br />
<br />
I hope that sorts your problem out. <br />
<br />
thanks - that's exactly what it was!!!<!--content-->No probs, glad I could help.<!--content-->ok i just used the site that byclops has posted there and it came up with 5 on mine...any suggestions how to fix it? here is what i got<br />
<br />
Line 1, character 1: <br />
<html><br />
^<br />
Error: missing document type declaration; assuming HTML 4.01 Transitional<br />
1 <html><br />
2 <br />
3 <head><br />
4 <title> Please email us your ideas or suggestions </title><br />
<br />
Line 5, character 8: <br />
<script> <br />
^<br />
Error: required attribute TYPE not specified<br />
5 <script> <br />
6 function cancel_it() { <br />
7 var okay = confirm('Are you sure you want to cancel?'); <br />
8 if (okay == true) { <br />
9 window.location.href=http://www.htmlforums.com/archive/index.php/"../index.html"; <br />
10 <br />
11 } <br />
12 } <br />
13 </script><br />
<br />
Line 14, character 8: <br />
<script><br />
^<br />
Error: required attribute TYPE not specified<br />
14 <script><br />
15 <!-- This function performs a verification on Email Addresses <br />
16 function VerifyEmail(eadd) { <br />
17 if (eadd == null || eadd == "") { //Not empty <br />
18 alert ("Please enter your Email Address"); <br />
19 comments.email.focus(); <br />
20 return false; <br />
21 } <br />
22 atPos= eadd.indexOf("@",1) <br />
23 // Check for the @ Symbol <br />
24 if (atPos == -1) { <br />
25 alert ("Please enter a valid Email Address"); <br />
26 comments.email.focus(); <br />
27 return false; <br />
28 } <br />
29 if (eadd.indexOf("@",atPos+1) != -1) { <br />
30 // Check for only one @ Symbol <br />
31 alert ("Please enter a valid Email Address"); <br />
32 comments.email.focus(); <br />
33 return false; <br />
34 } <br />
35 periodPos = eadd.indexOf(".",atPos) <br />
36 if (periodPos == -1) { <br />
37 // Check for at least one . after the @ <br />
38 alert ("Please enter a valid Email Address"); <br />
39 comments.email.focus(); <br />
40 return false; <br />
41 } <br />
42 if (periodPos+3 > eadd.length) { <br />
43 // Check for at least Two Char. after the "." <br />
44 alert ("Please enter a valid Email Address"); <br />
45 comments.email.focus(); <br />
46 return false; <br />
47 } <br />
48 return true <br />
49 }<br />
50 </script><br />
<br />
Line 53, character 45: <br />
... d="tvbkgnd.gif" bgproperties="fixed"><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br />
Error: there is no attribute BGPROPERTIES for this element (in this HTML version)<br />
53 <body background="tvbkgnd.gif" bgproperties="fixed"><br />
<br />
Line 66, character 8: <br />
<script> <br />
^<br />
Error: required attribute TYPE not specified<br />
66 <script> <br />
67 <br />
68 //Made by A1 JavaScripts - <!-- m --><a class="postlink" href="http://www.a1javascripts.com">http://www.a1javascripts.com</a><!-- m --> <br />
69 //Use freely but please keep the credits in place <br />
70 //Not to be exhibited on any other archive without permission <br />
71 <br />
72 <!-- <br />
73 function validateform(comments) { <br />
74 if ( <br />
75 comments.RECIPIENT.value==""|| <br />
76 comments.name.value==""<br />
77 ) <br />
78 { <br />
79 window.alert ("Please enter your name.") <br />
80 return false; <br />
81 } <br />
82 } <br />
83 //--> <br />
84 </script><br />
<br />
well that's everything it's calling an error or warning on can someone maybe tell me what would need changed to keep from getting those?<!--content-->The script tags should reflect both the language and/or mime types in them to be HTML 4 compliant.<br />
<br />
<script language="Javascript" type="text/javascript"><br />
<br />
However, as the language attribute is not supported in early browsers I believe you can get away with just having the type attribute in HTML 4 Transitional. You need to add those attribs to all the <script> tags.<br />
<br />
As for the bgproperties attribute you have in the <body> tag, this is a MSIE extension and not part of HTML 4. You need to use a css style to create the affect you desire. <br />
<br />
<style type="text/css"><br />
body { background: fixed; }<br />
</style><br />
This is not NS4 compatible though.<!--content-->ok not sure about the java thing but as far as the bgproperties="fixed" that works and does just fine with all my pages but that maybe why the script dont want to work like it's supposed to<!--content-->All of the fixes are correct that were given just so long as you validate it with a DOCTYPE of HTML 4.01 Transitional.<br />
<br />
Transitional is a more friendly version of HTML than the HTML 4.01 Strict version.<!--content-->point by point.<br />
<br />
Line 1: This should always be a doc type declaration so your browsers knows what it is. In your case it should be:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
Line 5: You need to declare what language your script is in, not my field so don't know what one you are using. <br />
for example if you were using Java Script it would be as follows:<br />
<br />
<script language="JavaScript"><br />
<br />
Line 14: As above.<br />
<br />
Line 53: The problem is the attribute for bgproperties. Did you know this attribute only works in internet explorer (although I am not sure of other 6th gen browsers). If your validator is hardcore to the truth, i.e. HTML 4.01 than this attribute may be invalid, but it could be because you have speach marks around it and (I think) are not supposed to be there. The correct way of doing this would be to set a fixed background using CSS and would solve this problem. Try this: (also let me know if you don't know the CSS equiv and I will sort it out for you, being lazy, sorry).<br />
<br />
<body background="tvbkgnd.gif" bgproperties=fixed><br />
<br />
Line 66: Same as line 5.<!--content-->Looks like I was moments too late, story of my life...:D<!--content-->
 
Back
Top