end tag for element "INPUT" which is not open

Discussion in 'HTML' started by Kurda Yon, Oct 9, 2008.

  1. Kurda Yon

    Kurda Yon Guest

    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.
     
    Kurda Yon, Oct 9, 2008
    #1
    1. Advertising

  2. Kurda Yon

    Kurda Yon Guest

    On Oct 8, 8:59 pm, Kurda Yon <> wrote:
    > 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...
     
    Kurda Yon, Oct 9, 2008
    #2
    1. Advertising

  3. Kurda Yon wrote:
    > 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>

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Oct 9, 2008
    #3
  4. Kurda Yon wrote:
    > On Oct 8, 8:59 pm, Kurda Yon <> wrote:
    >> 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...


    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.
     
    Harlan Messinger, Oct 10, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    894
    John C. Bollinger
    Jan 27, 2006
  2. mark4asp
    Replies:
    2
    Views:
    2,258
    Harry Haller
    Nov 7, 2006
  3. Mark Sullivan
    Replies:
    0
    Views:
    272
    Mark Sullivan
    Dec 21, 2007
  4. Jan Lelis
    Replies:
    22
    Views:
    305
    Robert Klemme
    Jul 13, 2010
  5. john woo
    Replies:
    1
    Views:
    162
    David Dorward
    Jun 29, 2005
Loading...

Share This Page