end tag for element "INPUT" which is not open

K

Kurda Yon

Hi,

I try to validate an html document (strict). And I have the following
error:
end tag for element "INPUT" which is not open

It is strange, because I do open the input element:
This is the problematic line:
<div><input type="submit" value="Cancel"></input></div>

Could anybody help me with that?

Thank you in advance.
 
K

Kurda Yon

Hi,

I try to validate an html document (strict). And I have the following
error:
end tag for element "INPUT" which is not open

It is strange, because I do open the input element:
This is the problematic line:
<div><input type="submit" value="Cancel"></input></div>

Could anybody help me with that?

Thank you in advance.

That is strange. I have realized that I have to replace
<input type="submit" value="Cancel"></input>
by
<input type="submit" value="Cancel"/>.

Now the validator does not complain. However, it writes me warnings:
The sequence <FOO /> can be interpreted in at least two different
ways, depending on the DOCTYPE of the document. For HTML 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
HTML 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.

So, it looks like the validator forced me to write my code in a
special way and after I did it, the validator tells me that it is not
a good idea to write the code in this way...
 
J

Jonathan N. Little

Kurda said:
Hi,

I try to validate an html document (strict). And I have the following
error:
end tag for element "INPUT" which is not open

It is strange, because I do open the input element:
This is the problematic line:
<div><input type="submit" value="Cancel"></input></div>

Could anybody help me with that?

Thank you in advance.

Because in HTML 4.01 INPUT does not have a closing tag.

http://www.w3.org/TR/html4/interact/forms.html#edef-INPUT

<div><input type="submit" value="Cancel"></div>
 
H

Harlan Messinger

Kurda said:
That is strange. I have realized that I have to replace
<input type="submit" value="Cancel"></input>
by
<input type="submit" value="Cancel"/>.

Now the validator does not complain. However, it writes me warnings:
The sequence <FOO /> can be interpreted in at least two different
ways, depending on the DOCTYPE of the document. For HTML 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
HTML 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.

So, it looks like the validator forced me to write my code in a
special way and after I did it, the validator tells me that it is not
a good idea to write the code in this way...

If your document was being treated as HTML 4.01 strict, the validator
would never tell you to use <input ... />. If your document is being
treated as XHTML, then the validator would tell you you *have* to have
the slash (or an explicit end tag, </input>), and it would not complain
when you do so.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top