Can't figure out XHTML validation error

They have: 222 posts

Joined: Sep 1999

I'm trying to validate my new blog design and I can't figure out why it's complaining about this markup:

<div id="search">
<form method="get" id="searchform" action="/blog/index.php">
<input type="text" value="" name="s" id="s"><br />
<input type="submit" id="searchsubmit" value="Search">
</form> </div>
'

Also, what's up with that "Unknown Parse Mode!" error?

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Not too sure about the parse error:

Quote:
The MIME Media Type (text/html) for this document is used to serve both SGML and XML based documents, and it is not possible to disambiguate it based on the DOCTYPE Declaration in your document. Parsing will continue in SGML mode.

Maybe it has something to do with your doctype?

Also, you need to close off your INPUT tags so this:

<input type="text" value="" name="s" id="s">
'

Becomes this:

<input type="text" value="" name="s" id="s" />
'

They have: 222 posts

Joined: Sep 1999

I fixed that, but I'm still getting the errors.

"document type does not allow element "INPUT" here". It's inside form tags, so what could be wrong?

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Firstly you're using xhtml 1.1 and that requires a MIME type of text/xml not text/html this is the first DOCTYPE that shifts you from SGML to XML... But that's another story.

Simply put:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
'in place of:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
'
Then change:
<div id="search">
<form method="get" id="searchform" action="/blog/index.php">
<input type="text" value="" name="s" id="s" /><br />
<input type="submit" id="searchsubmit" value="Search" />
</form> </div>
' to
<form method="get" id="searchform" action="/blog/index.php">
<div id="search">
<input type="text" value="" name="s" id="s" /><br />
<input type="submit" id="searchsubmit" value="Search" />
</div></form>
' Either that or:
<div id="search">
<form method="get" id="searchform" action="/blog/index.php"><fieldset>
<input type="text" value="" name="s" id="s" /><br />
<input type="submit" id="searchsubmit" value="Search" />
</fieldset></form></div>
'
This is because the Document Type constrains the child elements of a form to block level elements only (aside from more forms).

This should fix the problem!

a Padded Cell our articles site!

They have: 222 posts

Joined: Sep 1999

Thank fixed it, thanks Smiling

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Glad to be of service!

*glint of sun shining off brilliant smile*

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.