Solved

w3c validation ASP VBScript problem with - <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

Posted on 2008-10-26
10
2,899 Views
Last Modified: 2013-11-19
Hi there,

I'm trying to validate an ASP VBscript page, but when i test the code below, I get the following errors -

Validation Output: 4 Errors
 Line 1, Column 0: character "<%" not allowed in prolog.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>       
 Line 64, Column 98: required attribute "cols" not specified.
&e" id="message" rows="8" tabindex="3"></textarea></li>       
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>.

 Line 1, Column 1: XML Parsing Error: StartTag: invalid element name.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>       
 Line 1, Column 1: XML Parsing Error: Extra content at the end of the document.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

Please can you advise where i am going wrong here?

thank you
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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"><!-- InstanceBegin template="/Templates/templateasp.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<meta name="description" content="xxx" />
<meta name="keywords" content="xxx" />
<meta name="Robots" content="index,follow" />
<meta name="Revisit-After" content="10 days" />
<meta http-equiv="author" content="Gareth Tannatt Nash" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<script type="text/javascript">
<!--
function formButtonFever(formName,action){
	var myString = "document."+formName+"."+action+"();";
	eval(myString);
	}
//-->
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<link href="styles/main.css" rel="stylesheet" type="text/css" media="all" />
</head>
<!-- InstanceEndEditable -->
<body>
<div id="shell">
<div id="header">
  <div class="navbar">
    <ul class="navbar">
      <li><a href="#">Contact</a></li>
      <li><a href="#">Location</a></li>
      <li><a href="#">Photos</a></li>
      <li><a href="#">Facilities</a></li>
      <li><a href="#">Home</a></li>
    </ul>
    </div>
</div>
<div id="contentHolder">
  <div id="contentLeft">
  <div id="contentlefttop"><img src="images/maisondumarin.gif" alt="maisondumarin" width="201" height="121" /></div>
  <div id="holidayacom">
    <h1>Holidays in France for people with or without a disability.</h1>
  </div>
  <div id="nonsmoking"><img src="images/nonsmoking.gif" alt="nn" width="200" height="57" /></div>
  <div id="address">
    <p>Maison Du Marin  </p>
    <p>Puypelat 24470  </p>
    <p>St Pardoux La Riviere  </p>
    <p>France  </p>
    <p>Tel: 0033 (0) 553 56 33 30</p>
  </div>
  </div>
    
  <div id="mainright2"><!-- InstanceBeginEditable name="mainarea" -->
    <div class="inneraddresstop">
      <p>If you have any enquiries please use the contact form below or feel free to contact us directly</p></div>
      <div class="inneraddressform">
        <form id="contact" name="contact" method="post" action="">
          <ul>
            <li><label>Your Name:</label><input type="text" name="name" id="name" tabindex="1" /></li>
            <li><label>Your Email:</label><input type="text" name="email" id="email" tabindex="2" /></li>
            <li><label>Message:</label><textarea name="message" id="message" rows="8" tabindex="3"></textarea></li>
            <li><img src="images/send.gif" alt="send" width="136" height="33" onclick="formButtonFever('contact','submit')" /></li>
          </ul>
        </form>
      </div>
      <div class="inneraddress">
        <p><strong>Address:</strong></p>
        <p>Maison Du Marin </p>
        <p>Puypelat 24470 </p>
        <p>St Pardoux La Riviere </p>
        <p>France </p>
        <p>Tel: 0033 (0) 553 56 33 30</p>
      </div>
  <!-- InstanceEndEditable --></div>
  </div>
<div id="footer"></div>
</div>
</body>
<!-- InstanceEnd --></html>

Open in new window

0
Comment
Question by:garethtnash
  • 5
  • 4
10 Comments
 
LVL 11

Expert Comment

by:jgmontgo
ID: 22806993
The only real problem in your source code would be line 64, it should be:
<li><label>Message:</label><textarea name="message" id="message" rows="8" tabindex="3" cols="1"></textarea></li>
I am not sure why the w3c validation of ASP VBScript is reporting the other issues, because they are not really issues. Perhalps it is a bug or non implimented validation in the validator.
Here is your source with the corrected line 64:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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"><!-- InstanceBegin template="/Templates/templateasp.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<meta name="description" content="xxx" />
<meta name="keywords" content="xxx" />
<meta name="Robots" content="index,follow" />
<meta name="Revisit-After" content="10 days" />
<meta http-equiv="author" content="Gareth Tannatt Nash" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<script type="text/javascript">
<!--
function formButtonFever(formName,action){
	var myString = "document."+formName+"."+action+"();";
	eval(myString);
	}
//-->
</script>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<link href="styles/main.css" rel="stylesheet" type="text/css" media="all" />
</head>
<!-- InstanceEndEditable -->
<body>
<div id="shell">
<div id="header">
  <div class="navbar">
    <ul class="navbar">
      <li><a href="#">Contact</a></li>
      <li><a href="#">Location</a></li>
      <li><a href="#">Photos</a></li>
      <li><a href="#">Facilities</a></li>
      <li><a href="#">Home</a></li>
    </ul>
    </div>
</div>
<div id="contentHolder">
  <div id="contentLeft">
  <div id="contentlefttop"><img src="images/maisondumarin.gif" alt="maisondumarin" width="201" height="121" /></div>
  <div id="holidayacom">
    <h1>Holidays in France for people with or without a disability.</h1>
  </div>
  <div id="nonsmoking"><img src="images/nonsmoking.gif" alt="nn" width="200" height="57" /></div>
  <div id="address">
    <p>Maison Du Marin  </p>
    <p>Puypelat 24470  </p>
    <p>St Pardoux La Riviere  </p>
    <p>France  </p>
    <p>Tel: 0033 (0) 553 56 33 30</p>
  </div>
  </div>
    
  <div id="mainright2"><!-- InstanceBeginEditable name="mainarea" -->
    <div class="inneraddresstop">
      <p>If you have any enquiries please use the contact form below or feel free to contact us directly</p></div>
      <div class="inneraddressform">
        <form id="contact" name="contact" method="post" action="">
          <ul>
            <li><label>Your Name:</label><input type="text" name="name" id="name" tabindex="1" /></li>
            <li><label>Your Email:</label><input type="text" name="email" id="email" tabindex="2" /></li>
            <li><label>Message:</label><textarea name="message" id="message" rows="8" tabindex="3" cols="1"></textarea></li>
            <li><img src="images/send.gif" alt="send" width="136" height="33" onclick="formButtonFever('contact','submit')" /></li>
          </ul>
        </form>
      </div>
      <div class="inneraddress">
        <p><strong>Address:</strong></p>
        <p>Maison Du Marin </p>
        <p>Puypelat 24470 </p>
        <p>St Pardoux La Riviere </p>
        <p>France </p>
        <p>Tel: 0033 (0) 553 56 33 30</p>
      </div>
  <!-- InstanceEndEditable --></div>
  </div>
<div id="footer"></div>
</div>
</body>
<!-- InstanceEnd --></html>

Open in new window

0
 

Author Comment

by:garethtnash
ID: 22807026
Thanks jgmontgo, the only problem I have is that given my clients industry, i guaranteed w3c validation, all of the other pages are fine, just this one that has the problem -
0
 
LVL 11

Expert Comment

by:jgmontgo
ID: 22807033
I checked the list of error messages from w3c and was only able to find the first one, it is listed as having no explination.
When I test a blank ASP VBScript document created by Adobe Dreamweaver CS3 I test the resulting code and get the same exact error messages that you are getting. So it is a problem with the validation tool.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 11

Expert Comment

by:jgmontgo
ID: 22807210
Ok, are the other pages ASP VBScript and do they include at least the following:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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>Untitled Document</title>
</head>
 
<body>
</body>
</html>

Open in new window

0
 
LVL 11

Expert Comment

by:jgmontgo
ID: 22807219
Actually, do the rest of the files start with the following line in the source? If it is removed it passes:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

Open in new window

0
 

Author Comment

by:garethtnash
ID: 22807362
so just remove that line? the other pages are .html..
 
thanks
0
 
LVL 11

Expert Comment

by:jgmontgo
ID: 22807392
Yea, just remove that line. The error "Line 1, Column 0: character "<%" not allowed in prolog." Basically means that the line we are removing can not be in that part of the source file.  
That also explains why the other pages do not have teh error, they are HTML so they dont have this line.
0
 

Author Comment

by:garethtnash
ID: 22811257
Thanks jgmontgo, I've done that, but I still get the following error -
 
Line 66, Column 101: there is no attribute "onClick".&end" width="136" height="33" onClick="formButtonFever('contact','submit')" />
 
I've moved the site to a live test enviroment -
  http://www.dewchurch.info/contact.asp
0
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 22814538
In XHTML all element and attribute names are lowercase, so change "onClick" to "onclick".

It's best to avoid using inline event handlers though.
0
 

Author Comment

by:garethtnash
ID: 23119799
Excellent thank you
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Swiper slider stops between pages 11 50
Stupid git question 2 89
Bypass cross origin issues on development site 3 77
Issues with Insert statement 12 27
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question