HTML - Issues At W3c Validator
Hello Guys,
This is my first thread. When i try to validate website at W3C.org, i found many errors but below 2 are main reasons to write here. Errors 1) Line 424, Column 88: document type does not allow element "FORM" here 2) Line 425, Column 6: document type does not allow element "TR" here I've called 4 php files using include tag in my index.php. Here are codes of right.php from where errors has come. Code: <table width="100%" border="0" cellspacing="0" cellpadding="5" class="arial1" style="border-bottom-color:#999999; border-bottom-style:solid; border-bottom-width:1px; border-top-color:#999999; border-top-style:solid; border-top-width:1px; border-left-color:#999999; border-left-style:solid; border-left-width:1px; border-right-color:#999999; border-right-style:solid; border-right-width:1px;"> <form name="frmRight" method="post" action="<?php echo __HOST__?>pro_search.php"> <tr> <td align="center" bgcolor="#FF0000"><span class="Times2">Product Search </span></td> </tr> <tr> <td height="33" align="center"><input name="pro_search" class="inputbox150" type="text" id="pro_search" size="20" maxlength="25" /></td> </tr> <tr> <td height="35" align="center"><input type="submit" name="Submit" value="GO" class="button03"/></td> </tr> <tr> <td align="center"></td> </tr> </form> </table> <br> If you want to check website directly on W3C validation service, please note site: www.abroadpharma.com line # 424 & 425. Thanks Similar TutorialsHi, since I realized my site hrttp://www.homeofsolarenergy.com does badly on older browsers, I try to learn and improve what to do better. So I asked the W3 validator what it thinks. Ie I got this: Validation Output: 2 Errors Quote: Error Line 17, Column 7: end tag for element "HEAD" which is not open </HEAD> ✉ The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem. If this error occurred in a script section of your document, you should probably read this FAQ entry. Error Line 19, Column 6: document type does not allow element "BODY" here <BODY> ✉ The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). this is illogical, I do not understand WHY this error is... this is the code Quote: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- "http://www.w3.org/TR/html4/loose.dtd"> --> <HTML> <HEAD> <TITLE>Solar Energy - all you need to save with Alternative Renewable or Free Energy Power</TITLE> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <META NAME="alexaVerifyID" CONTENT="XqpGosWsCeKgIaNgOU8A2nObYIc"> <META NAME="Description" CONTENT= "Solar Energy - all you need to save with Renewable or Free Power - Switch to Free and Alternative Energy Sources - save using our future fuels for your home, car and business"> <META NAME="Keywords" CONTENT= "solar energy, renewable energy, alternative energy, free energy"> <META NAME="msvalidate.01" CONTENT="56138183B8066F1E81DADF27CF1699C1"> <LINK HREF="support-files/style.css" REL="stylesheet" TYPE="text/css"> <META NAME="msvalidate.01" CONTENT="56138183B8066F1E81DADF27CF1699C1">. </HEAD> <BODY> I have NO idea why it doesn't like my HTML tags can you help me please?? Thank you Daniel Hi All, Is it worthy to get my asp.net front (contains lots of html code and server side controls) validated by W3C html validator? In otherwords, how can i validate asp.net controls, e.g. this piece of code wont passed by w3c validator: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>TMS</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <form id="MainForm" action="Boot.aspx"> <table> <tr> <td><asp:Label ID="lblOrgName" runat="server"></asp:Label></td> </tr> </table> </form> </body> </html> It complains the ID and runat attribute of asp:Label element. Thanks in advance. Hi all, I wrote my page in xhtml transitional, and up till last week everything validated fine. Today I tried and it returns three errors. For your convenience I've listed the links to my page, to the validator results, and the relevant code/errors below. Can anybody tell me what I'm missing? I'm very new to this. Thank you! my page: http://www.indiana.edu/~meis/ validator results: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.indiana.edu%2F%7Emeis%2F&charset=%28detect+automatically%29&doctype=Inlin e&group=0 relevant code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Middle Eastern and Islamic Studies: Indiana University</title> errors: Validation Output: 3 Errors 1. Error Line 97, Column 10: "DOCTYPE" declaration not allowed in instance. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w 2. Error Line 98, Column 42: document type does not allow element "html" here. <html xmlns="http://www.w3.org/1999/xhtml"> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). 3. Error Line 97, Column 9: XML Parsing Error: StartTag: invalid element name. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w Well, i'm not sure i'm gonna use this snippet but i can think of plenty reasons why i might: Code: <h4 style="display:<?php print $display; ?>"> It won't validate because, quote: "character "<" is the first character of a delimiter but occurred as data." Maybe i've been staring at it too long but i don't see the difference from any other php statement, which the validator should simply not parse. ?? Thanks, Joey I'm checking my site with the validator.w3 site, and it shows errors and instructions to fix the errors. can you help me with these two? What should this line of code look like corrected, please? Validator code & instructions: Code: (var i =0; i < cb.elements.length; i++)You tried to include the "<" character in your page: you should escape it as "<" What does this line of code need? Validator code & instructions: Code: <img src="themes/default/images/logo.jpg" border="0" />The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element. Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>. thanks Hey, I just ran my index page through W3C validation and i have a few errors which I'm not sure how to fix. If anyone can help out that would be appreciated. I have a form: HTML Code: <div id="newsletter"> <p>Sign up for our newsletter</p> <form action="http://somesite.com" method="post"> First name: <br /><input type="text" name="firstname" /> <br /> E-mail: <br /><input type="text" name="email" /> </form> </div> But w3c validator doesn't like any of the <br /> tags: Quote: document type does not allow element "br" here; I have placed <p> tags there instead, and i get no errors in the validator, but my inputs are too spaced apart. With the title before my form "First name" and "E-mail". w3c highlights the first letter in red saying: Quote: character data is not allowed here. How can i fix this? And last one. I have one image on my page I'm validating: Code: <img src="images/coffee_bar.jpg" alt="coffee bar" class="image" align="right"/> Validator: Quote: there is no attribute "align" Is there another way to write this?? Thanks for any help!! Hey! I have run my site through the W3C validator and have a bunch of errors coming up for problems supposedly within my meta keyword and meta description tags. I've been trying to figure out why it's not liking what i have but can't figure it out. If anyone could help me out i would really appreciate it! My webpage is paleocookbook.com and the problems i'm having appear when doing a quick validator check at http://validator.w3.org Any help is greatly appreciated. Hi there, Im trying to figure out the following error: Validation Output: 1 Error 1. Error Line 28, Column 48: Stray script start tag. <script type="text/javascript" src="js/base.js" > </script> Any thoughts ? Thanks Here is my link http : // 173 dot 45 dot 229 dot 122 / phpBB3 / (without spaces) I give this url and check for validation I get sum 41 errors. - This is one way I do View Source and check for validation I get 103 errors - This is another way Why do I get different results like this? Am using a PHPBB3 thats a CMS kind application where 80% would be driven by default phpbb3 itself 20% is my work.... what to do for this kind of site???? am depressed Any solutions? Can someone tell me how to fix this error: http://validator.w3.org/check?uri=ww...Inline&group=0 Hi all, Could somebody please give me a hand as to why this contact form is not working? In the Head section: Code: <script type="text/javascript"> function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@"); dotpos=value.lastIndexOf("."); if (apos<1||dotpos-apos<2) {alert(alerttxt);return false;} else {return true;} } } function validate_form(thisform) { with (thisform) { if (validate_email(email,"Not a valid e-mail address!")==false) {email.focus();return false;} } } </script> In the HTML body section: Code: <form id="contacts-form" onsubmit="return validate_form(this)" action="contact.php" method="get"> <div class="wrapper"> <div class="col-1"> <label>Name:<br /><input type="text" name="name" required/></label> <label>E-mail:<br /><input type="text" name="email" required/></label> </div> <div class="col-2"> Message:<br /><textarea cols="" name="message" required rows=""></textarea> <div class="alignright"><a href="#" onClick="document.getElementById('contacts-form').reset()" class="more"><strong>clear</strong></a> <a href="#" onClick="document.getElementById('contacts-form').submit()" class="more"><strong>send message</strong></a> </div> </div> </div> </form> It just sends the form without validating the email address, Any help would be wonderful. Thanks I made a part for sidebar, to put it in my blog, using free template i found in internet. Why does http://validator.w3.org doesn't like that part? Here it is....i posted that part in seperate page. At the begining it had 40 errors, but i figured out many of them, so now it shows only 8 errors. Maybe someone can help me find out, what is, that http://validator.w3.org doesn't like about that code, because i realy would like to validate it, but i am not so strong at this, as i made this from template. I hope i chose the right place or my thread...i am new here. Hi Jquery Guros, I develop register form (in arabic). I added "validator.addMethod" to check the firstname text.I want to check that the "firstname" text must be in INGLISH leter and Numbers(means, user can't insert arabic leters or anything else). I added the script: ///////// chack firstname (English leter OR numbers <b> Code: $.validator.addMethod("firstname",function(value,element){ return this.optional(element) || /^[a-zA-Z0-9._-]{3,16}$/i.test(value); },"Username are 3-15 characters"); </b> You can check the script at: http://www.alnaddy.com/ldap/index1.php Can anybody help me guys? Thanks a lot. Sam. |