Topic: can't get google search form to validate (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=23803" title="Pages that link to Topic: can&amp;#039;t get google search form to validate (Page 1 of 1)" rel="nofollow" >Topic: can&#039;t get google search form to validate <span class="small">(Page 1 of 1)</span>\

 
ninmonkeys
Nervous Wreck (II) Inmate

From:
Insane since: May 2004

posted posted 10-26-2004 06:37

This is driving me crazy, why doesn't this validate?

code:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>GoogleSearch</title>
</head>
<body>

<!-- Search Google, modified code from google.com -->
<a href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_40wht.gif" width="128" height="53" alt="Google" /></a>

<form method="get" action="http://www.google.com/search">
<input type="hidden" id="ie" value="UTF-8" />
<input type="hidden" id="oe" value="UTF-8" />
<input type="text" id="q" size="25" maxlength="255" value="" />
<input type="submit" id="btnG" value="Search" />
</form>


</body>
</html>

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 10-26-2004 06:54

is bs

ninmonkeys
Nervous Wreck (II) Inmate

From:
Insane since: May 2004

posted posted 10-26-2004 21:21

1) I don't understand. Do you mean the code should be validating?

I'm reading at w3c.org and their example has

code:
<?xml version="1.0" encoding="utf-8"?>

as the first line of their example.

2) What does it mean, and should I be using it on all xhtml 1.0 strict documents I write?

3) When would I want to use the doctype transitional xhtml 1.0 instead of strict?

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 10-26-2004 21:51

Well......why does it say it is not validating?

I don't use an XML declaration, but I do specify this -
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

in all my XHTML documents.





(Edited by DL-44 on 10-26-2004 21:54)

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 10-26-2004 22:37
quote:
I don't understand.



Me either! That was my point, sorry to even have said it if I was going to be so cryptic and brief. I was just voicing my displeasure at the validator's cryptic explanations of the problem, it does that a lot. Their help is hardly that sometimes. You usually have to work backwards in the markup from the point of their first exception to find the real problem.

grrrr

DL or Cameron should be along any sec to prove once again that anger and frustration cloud the feeble mind

Cameron
Paranoid (IV) Inmate

From: Brisbane, Australia
Insane since: Jan 2003

posted posted 10-26-2004 22:40

You need to wrap some block level elements around parts of the content.

This should work:

code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<title>GoogleSearch</title>

</head>

<body>

<!-- Search Google, modified code from google.com -->
<p>
<a href="http://www.google.com/"><img src="http://www.google.com/logos/Logo_40wht.gif" width="128" height="53" alt="Google" /></a>
</p>

<form method="get" action="http://www.google.com/search">
<p>
<input type="hidden" id="ie" value="UTF-8" />
<input type="hidden" id="oe" value="UTF-8" />
<input type="text" id="q" size="25" maxlength="255" value="" />
<input type="submit" id="btnG" value="Search" />
</p>
</form>

</body>

</html>

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 10-26-2004 22:45

That just seems so wrong.

ninmonkeys
Nervous Wreck (II) Inmate

From:
Insane since: May 2004

posted posted 10-26-2004 22:47

Thank you, it works

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 10-26-2004 23:39

yay!

Cameron
Paranoid (IV) Inmate

From: Brisbane, Australia
Insane since: Jan 2003

posted posted 10-27-2004 00:01

One of the links on that page seems so very, very wrong.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 10-27-2004 00:31

Rather semantically poor to use a <p> though - you're not presenting a paragraph.

A <div> would be much more suitable. You don't need two of them either - one div wrapping the whole shebang should do it.

Of course, as alluded to in my first post, the W3C validators (can't speak for any other) would certainly have pointed out the problem, even if somewhat inspecifically.



(Edited by DL-44 on 10-27-2004 00:32)

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 10-27-2004 00:42

actually they did point it out but it didn't register at all for me because of the semantically correct thing, it just didn't make sense so I all but dismissed it because of my previous experiences with validator vagueries. At one time I wrapped the form in a div just to see what would happen but I I still got an error (assumably because the image was left naked). Then I went off on a tangential thought and never came back.

Lame explanations for my scatterbrainedness aside, why in the world does it require a wrapper of ANY kind?! The body is not sufficient?

ninmonkeys
Nervous Wreck (II) Inmate

From:
Insane since: May 2004

posted posted 10-27-2004 02:12
quote:
DL-44 said:
A &lt;div&gt; would be much more suitable. You don't need two of them either - one div wrapping the whole shebang should do it.

I begain with a single div with the images and form tags inside it, and that didn't validate...

quote:
JKMabry said:
why in the world
does it require a wrapper of ANY kind?! The body is not sufficient?

Untill now, most of the validator errors I ran into where self explainatory or easy to figure out what the problem was. This one was cryptic to me.

I was also wondering, maybe since it's strict xhtml forms, or input elements can't be children of the body?



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu