Solved

W3C standards "http://www.w3.org/TR/html4/strict.dtd"

Posted on 2007-11-16
8
2,572 Views
Last Modified: 2013-11-19
I have the following errors coming when I use http://validator.w3.org/
to validate my page:
Here is my page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> 
<html>
<head>
<title> paswordform</title>
</head>
<body>
<!--center-->
<!--The center element is not supported in XHTML 1.0 Strict DTD-->
<!--use CSS-->
 
<form id="form" action="" onsubmit="return false" >
     <input id="Password1" type="password" maxlength="20"  />
      &nbsp; &nbsp; &nbsp;
     <input name="button" id="button" type="button" onclick="Login()" value="Login" />
  <!--input name="button" type="button" id="button" onClick="login()" value="Login"-->
</form>
<!--/center-->
<!--The center element is not supported in XHTML 1.0 Strict DTD-->
<!--use CSS-->
</body>
</html>

--------------------------------------------------------------------------------------------

Validation Output: 4 Errors
 Line 13, Column 60: NET-enabling start-tag requires SHORTTAG YES.
      <input id="Password1" type="password" maxlength="20"  /> ✉
The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HMTL 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HMTL 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

 Line 13, Column 60: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
      <input id="Password1" type="password" maxlength="20"  /> ✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

 Line 13, Column 61: character data is not allowed here.
… <input id="Password1" type="password" maxlength="20"  /> ✉
You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include:

putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see Empty elements in SGML, HTML, XML, and XHTML.

 Line 15, Column 85: NET-enabling start-tag requires SHORTTAG YES.
…ton" onclick="Login()" value="Login" />✉
The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HMTL 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HMTL 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.

 Line 15, Column 85: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
…ton" onclick="Login()" value="Login" />✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

 Line 17, Column 6: end tag for "FORM" which is not finished.
</form>✉
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.

Can someone help me with these errors?


0
Comment
Question by:mathieu_cupryk
  • 5
  • 3
8 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 20300575
Hello,

Change the inputs so that they are not self closing

<input id="Password1" type="password" maxlength="20"  />

to

<input id="Password1" type="password" maxlength="20"></input>


See where we are after you make those changes

Steggs
0
 

Author Comment

by:mathieu_cupryk
ID: 20300686
Hi Steggs, it gives me

 Line 13, Column 57: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
     <input id="Password2" type="password" maxlength="20"></input>✉

What can I do know?
0
 
LVL 30

Expert Comment

by:Steggs
ID: 20300855
Hey,

you need to put the input inside a block level element like a <div> or a <fieldset>

Steggs
0
 

Author Comment

by:mathieu_cupryk
ID: 20300878
Something like this?

<form id="form" action="" onsubmit="return false" >
<div>
     <input id="Password2" type="password" maxlength="20"></input>
     <input name="button" id="button" type="button" onclick="Login()" value="Login"></input>
</div>
</form>
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Expert Comment

by:Steggs
ID: 20300891
yes... give that a go
0
 

Author Comment

by:mathieu_cupryk
ID: 20300903
Byte-Order Mark found in UTF-8 File.

The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.

Validation Output: 2 Warnings
Below is a list of the warning message(s) produced when validating your document.

 Line 15, Column 57: NET-enabling start-tag requires SHORTTAG YES.
     <input id="Password2" type="password" maxlength="20"/>
0
 

Author Comment

by:mathieu_cupryk
ID: 20307670
Syntax would go something liike this:
<div>
<input id="Password2" type="password" maxlength="20">
     <input name="button" id="button" type="button" onclick="Login()" value="Login">
</div>

Will work. I will give u a B for trying.  
0
 

Author Closing Comment

by:mathieu_cupryk
ID: 31409622
You pointed me in a good direction.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now