By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Why won't this validate?

P: n/a
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>Evaluation - 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.html">Register New</a></li>
<li><a href="javascript:logInR();">Edit Profile</a></li>
<li><input type="password" name="username1" ></li>
<li><a href="javascript:logIn();">Login Client</a><span
id='errorMsg'></span></li>
</ul>
</div>
</div>
</form>
</div>
</body></html>
--
Ed Jay (remove 'M' to respond by email)
Apr 18 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ed Jay <ed***@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, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"The handwriting on the wall may mean you need a notepad by the phone."
Apr 18 '07 #2

P: n/a
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>Evaluation - Lab Home Page</h3></div>
Where are h1 and h2?
<li><a href="javascript:logInR();">Edit Profile</a></li>
What happens when that link is activated and JavaScript is not enabled
or it's unavailable?

Osmo
Apr 18 '07 #3

P: n/a
Els
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/
Apr 18 '07 #4

P: n/a
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)
Apr 18 '07 #5

P: n/a
Darin McGrew scribed:
>Ed Jay <ed***@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)
Apr 18 '07 #6

P: n/a
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>Evaluation - Lab Home Page</h3></div>

Where are h1 and h2?
Didn't use them on this page. No reason to.
>
><li><a href="javascript:logInR();">Edit 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)
Apr 18 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.