Auto-inserted "input" element is causing XHTML 1.0 Strict validation to fail

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all:
I originally posted this in an HTML forum, but have realized that the
solution may (a) require a server-side change or (b) be non-existent.
In any case, since the page I'm dealing with is a PHP page and the
problem has to do with an auto-inserted "input" element, I'll post it
here, too. I'd appreciate any advice, commentary, or even pessimistic
sympathy if I'm just SOL. - Thanks.

I am pasting some code below that I am having a lot of trouble with. I
have a php guestbook page that I'm trying to validate, and I keep
getting an error stating that I can't have a certain "input" element in
a location in which I am not actually attempting to place one at all. I
have tried to enclose all other input elements in blocks of "td" tags,
which has worked for the most part, but because this particular input
element seems to be dynamically generated, I can't figure out what I
ought to do to prevent it from producing this kind of error.

Here's the error code:

Error  Line 71 column 153: document type does not allow element "input"
here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div",
"pre", "address", "fieldset", "ins", "del" start-tag.

...="fa4a5c7b4eab7d80abb333272ea9d308" /><table
style="width:100%;"><tr><td cols

Here is the PHP code in which this is actually occuring (I've verified
that this is where it's occurring by making minute changes and
re-viewing a validation check):

print "<form method=\"post\"
[auto-insert of input element seems to be occurring here]
print "<table style=\"width:100%;\">";
print "</table>";

And here's the actual URL:

So, my question is, since I know there may not be a lot I can do to
prevent the auto-insertion, does anyone have any suggestions on how I
might code around such an expected auto-insertion of an input element?
This is the only page on which I've had this problem, even though my
(much more complicated) weblog page validates perfectly (with the
exception of my web host's auto-inserted raw ampersands in the URL
links), and that page contains even more forms that are built in a
virtually identical fashion.

If anybody has any suggestions, that would be great.



Re: Auto-inserted "input" element is causing XHTML 1.0 Strict validation to fail

Kimmo Laine wrote:
Quoted text here. Click to load it

Unless next_page.php generates PHP, the script with this include will
only get HTML.

Quoted text here. Click to load it


    if (isset($_GET['foo'])) {
      echo '<?php echo $_GET[\'foo\']; ?>';
    } else {
      echo '<?php echo \'Not available\'; ?>';

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Re: Auto-inserted "input" element is causing XHTML 1.0 Strict validation to fail

Thanks for the links, however I don't have access to the php.ini files
for this site (it's shared, paid webspace). The information suggested
using "fieldset" tags, but I still need a "form" element in there (or
do I?), and as long as the "form" element is there, it's auto-inserting
a "hidden" input element that contains my PHPSESSID value.

Re: Auto-inserted "input" element is causing XHTML 1.0 Strict validation to fail

Solved it by using a function to reset the php.ini settings (didn't
realize I could do that! :)

Thanks for the help.

Site Timeline