Solved

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

Posted on 2007-11-16
8
2,561 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Form submit issue 11 56
updateParent() HTML Javascript 21 62
Problem to picture file 3 42
wordpress url rewriting plugin 5 11
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

10 Experts available now in Live!

Get 1:1 Help Now