Can't figure out XHTML validation error
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 posted this at 04:53 — 18th October 2005.
He has: 3,022 posts
Joined: Oct 2002
Not too sure about the parse error:
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" />
IanD posted this at 22:18 — 18th October 2005.
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?
Fighting for a Lost Cause.net
JeevesBond posted this at 23:01 — 18th October 2005.
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" >
<!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>
<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>
<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!
IanD posted this at 23:25 — 18th October 2005.
They have: 222 posts
Joined: Sep 1999
Thank fixed it, thanks
JeevesBond posted this at 00:59 — 19th October 2005.
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.