Why won't this validate?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Jay

    Why won't this validate?

    When I try to validate the following I receive three [identical] errors:

    Error Line 47 column 41: document type does not allow element "INPUT" here;
    missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
    "ADDRESS" start-tag.

    <input type = "hidden" name = "user" value = " ">
    <input type = "hidden" name = "talValue" value = "talValue">
    <input type = "hidden" name = "directIt" value = " ">

    My markup:
    <body>

    <div class = containerboxPre >

    <div class=framebox> <h3>Evaluatio n - Lab Home Page</h3></div>

    <form id='form1' name='form1' action="/cgi-bin/yada.pl" method="post">
    <input type="hidden" name="user" value="">
    <input type="hidden" name="talValue" value="talValue ">
    <input type="hidden" name="directIt" value="">

    <div class=framebox>
    <div class="topmenu" >
    <ul>
    <li><a href="yada1.htm l">Register New</a></li>
    <li><a href="javascrip t:logInR();">Ed it Profile</a></li>
    <li><input type="password" name="username1 " ></li>
    <li><a href="javascrip t:logIn();">Log in Client</a><span
    id='errorMsg'></span></li>
    </ul>
    </div>
    </div>
    </form>
    </div>
    </body></html>
    --
    Ed Jay (remove 'M' to respond by email)
  • Darin McGrew

    #2
    Re: Why won't this validate?

    Ed Jay <edMbj@aes-intl.comwrote:
    When I try to validate the following I receive three [identical] errors:
    >
    Error Line 47 column 41: document type does not allow element "INPUT" here;
    missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
    "ADDRESS" start-tag.
    >
    <input type = "hidden" name = "user" value = " ">
    <input type = "hidden" name = "talValue" value = "talValue">
    <input type = "hidden" name = "directIt" value = " ">
    >
    My markup:
    [...]
    <form id='form1' name='form1' action="/cgi-bin/yada.pl" method="post">
    <input type="hidden" name="user" value="">
    <input type="hidden" name="talValue" value="talValue ">
    <input type="hidden" name="directIt" value="">
    [...]
    </form>
    The Strict DTDs allow only block-level elements inside FORM, so you have to
    put the INPUT elements inside block-level elements. You can't put them
    directly inside the FORM element.
    --
    Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
    Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

    "The handwriting on the wall may mean you need a notepad by the phone."

    Comment

    • Osmo Saarikumpu

      #3
      Re: Why won't this validate?

      Ed Jay wrote:
      When I try to validate the following I receive three [identical] errors:
      >
      Error Line 47 column 41: document type does not allow element "INPUT" here;
      The error message is quite clear. INPUT is not allowed where it's
      nesting (directly under FORM).
      missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
      "ADDRESS" start-tag.
      That is: a block level container is required.
      <input type = "hidden" name = "user" value = " ">
      <input type = "hidden" name = "talValue" value = "talValue">
      <input type = "hidden" name = "directIt" value = " ">
      Validation quick fix: enclose them INPUTs in a DIV.
      My markup:
      <body>
      >
      <div class = containerboxPre >
      >
      <div class=framebox> <h3>Evaluatio n - Lab Home Page</h3></div>
      Where are h1 and h2?
      <li><a href="javascrip t:logInR();">Ed it Profile</a></li>
      What happens when that link is activated and JavaScript is not enabled
      or it's unavailable?

      Osmo

      Comment

      • Els

        #4
        Re: Why won't this validate?

        Ed Jay wrote:
        When I try to validate the following I receive three [identical] errors:
        >
        Error Line 47 column 41: document type does not allow element "INPUT" here;
        missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
        "ADDRESS" start-tag.
        It says that you can't put the input element where you put it, and
        that there's one of those other elements missing.
        <form id='form1' name='form1' action="/cgi-bin/yada.pl" method="post">
        <input type="hidden" name="user" value="">
        <inputcan't go directly inside <form>. You will need to wrap them in
        a 'p', 'h1', etc.
        Sinse they are hidden fields, you can easily just move them inside
        your <div class="framebox "- they won't take up any space anyway.

        --
        Els http://locusmeus.com/
        accessible web design: http://locusoptimus.com/

        Comment

        • Ed Jay

          #5
          Re: Why won't this validate?

          Els scribed:
          >Ed Jay wrote:
          >
          >When I try to validate the following I receive three [identical] errors:
          >>
          >Error Line 47 column 41: document type does not allow element "INPUT" here;
          >missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
          >"ADDRESS" start-tag.
          >
          >It says that you can't put the input element where you put it, and
          >that there's one of those other elements missing.
          >
          ><form id='form1' name='form1' action="/cgi-bin/yada.pl" method="post">
          ><input type="hidden" name="user" value="">
          >
          ><inputcan't go directly inside <form>. You will need to wrap them in
          >a 'p', 'h1', etc.
          >Sinse they are hidden fields, you can easily just move them inside
          >your <div class="framebox "- they won't take up any space anyway.
          Thanks, ELS.
          --
          Ed Jay (remove 'M' to respond by email)

          Comment

          • Ed Jay

            #6
            Re: Why won't this validate?

            Darin McGrew scribed:
            >Ed Jay <edMbj@aes-intl.comwrote:
            >When I try to validate the following I receive three [identical] errors:
            >>
            >Error Line 47 column 41: document type does not allow element "INPUT" here;
            >missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV",
            >"ADDRESS" start-tag.
            >>
            ><input type = "hidden" name = "user" value = " ">
            ><input type = "hidden" name = "talValue" value = "talValue">
            ><input type = "hidden" name = "directIt" value = " ">
            >>
            >My markup:
            >[...]
            ><form id='form1' name='form1' action="/cgi-bin/yada.pl" method="post">
            ><input type="hidden" name="user" value="">
            ><input type="hidden" name="talValue" value="talValue ">
            ><input type="hidden" name="directIt" value="">
            >[...]
            ></form>
            >
            >The Strict DTDs allow only block-level elements inside FORM, so you have to
            >put the INPUT elements inside block-level elements. You can't put them
            >directly inside the FORM element.
            Thanks, Darin.
            --
            Ed Jay (remove 'M' to respond by email)

            Comment

            • Ed Jay

              #7
              Re: Why won't this validate?

              Osmo Saarikumpu scribed:
              >Ed Jay wrote:
              >When I try to validate the following I receive three [identical] errors:
              >>
              >Error Line 47 column 41: document type does not allow element "INPUT" here;
              >
              >The error message is quite clear. INPUT is not allowed where it's
              >nesting (directly under FORM).
              >
              Understood (now). Thanks.
              >
              >Validation quick fix: enclose them INPUTs in a DIV.
              Yup.
              >
              >My markup:
              ><div class=framebox> <h3>Evaluatio n - Lab Home Page</h3></div>
              >
              >Where are h1 and h2?
              Didn't use them on this page. No reason to.
              >
              ><li><a href="javascrip t:logInR();">Ed it Profile</a></li>
              >
              >What happens when that link is activated and JavaScript is not enabled
              >or it's unavailable?
              >
              Nothing, but this is a private site and all my users have js enabled.
              Similarly, I'm not trying to anything insofar as SEO is concerned, as this
              portion of the site is password protected and not available to Joe Public.

              Thanks for the input.
              --
              Ed Jay (remove 'M' to respond by email)

              Comment

              Working...