Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2007-11-16
8
2,583 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

861 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