vailidation fail?

P

Paul Watt

Hi,
The following code fails validation when used with a html 4.01 strict DTD.
why and how can i fix it?
TIA
Paul

<form action="/cgi-sys/entropysearch.cgi" target=searchwindow
class="search">
<img src="images/search.gif" alt="search" width="70" height="13">
<input type="text" name="query" value="" />
<input type="hidden" name="user" value="dunmowka" />
<input type="hidden" name="basehref" value="http://dunmowkarate.co.uk"
/>
<input type="hidden" name="template" value="default" />
<input type="submit" value="Search" />
</form>
 
W

William Tasso

Fleeing from the madness of the jungle
Paul Watt <[email protected]> stumbled into
news:alt.html,alt.macromedia.dreamweaver,alt.www.webmaster
and said:

[Follow-ups suggested]
Hi,
The following code fails validation when used with a html 4.01 strict
DTD.
why and how can i fix it?

Is this a guessing game? how about some context? remainder of markup or
a URI would be useful.

ok - guessing ....
<form action="/cgi-sys/entropysearch.cgi" target=searchwindow
class="search">

target not allowed - lose it.
<img src="images/search.gif" alt="search" width="70" height="13">
<input type="text" name="query" value="" />

elements don't need the closing "/" in HTML - lose them
<input type="hidden" name="user" value="dunmowka" />
<input type="hidden" name="basehref"
value="http://dunmowkarate.co.uk"
/>
<input type="hidden" name="template" value="default" />
<input type="submit" value="Search" />
</form>

There is no fieldset defined - IIRC you do need some sort of containing
element - perhaps a <div> would do. Or maybe you need both - can't
remember now.
 
A

Adam Strickland

The only thing i know is to close your img tag:

<img src="images/search.gif" alt="search" width="70" height="13">

like so:

<img src="images/search.gif" alt="search" width="70" height="13" />
 
G

GreyWyvern

And lo, Adam Strickland didst speak in
alt.html,alt.macromedia.dreamweaver,alt.www.webmaster:

[top posting fixed]
The only thing i know is to close your img tag:

<img src="images/search.gif" alt="search" width="70" height="13">

like so:

<img src="images/search.gif" alt="search" width="70" height="13" />

Like William said, these are not allowed in HTML 4.01. All of these
should be removed from the original code given.

My question is, the OP gave us this block of code that didn't validate:

So who told him/her/it that it didn't validate? I don't know of any
"validation" tool which fails to also supply you with information helpful
in fixing the problem.

Grey
 
J

Jonathan N. Little

Paul said:
Hi,
The following code fails validation when used with a html 4.01 strict DTD.
why and how can i fix it?
TIA
Paul

<form action="/cgi-sys/entropysearch.cgi" target=searchwindow
class="search">
<img src="images/search.gif" alt="search" width="70" height="13">
<input type="text" name="query" value="" />
<input type="hidden" name="user" value="dunmowka" />
<input type="hidden" name="basehref" value="http://dunmowkarate.co.uk"
/>
<input type="hidden" name="template" value="default" />
<input type="submit" value="Search" />
</form>

To fix:

<form action="/cgi-sys/entropysearch.cgi" class="search">
<p>
<!-- elements below need to be contain in block element -->
<img src="images/search.gif" alt="search" width="70" height="13">
<input type="text" name="query" value="">
<input type="hidden" name="user" value="dunmowka">
<input type="hidden" name="basehref" value="http://dunmowkarate.co.uk">
<input type="hidden" name="template" value="default">
<input type="submit" value="Search">

</p>
</form>

1. No 'target' on 'form'
2. '<element />' on single tag elements for XHTML not HTML
3. IMG and INPUT elements need to be contained withing block element,
e.g., P, DIV, PRE, H# ADDRESS
 
P

Paul Watt

Jonathan N. Little said:
To fix:

<form action="/cgi-sys/entropysearch.cgi" class="search">
<p>
<!-- elements below need to be contain in block element -->
<img src="images/search.gif" alt="search" width="70" height="13">
<input type="text" name="query" value="">
<input type="hidden" name="user" value="dunmowka">
<input type="hidden" name="basehref"
value="http://dunmowkarate.co.uk">
<input type="hidden" name="template" value="default">
<input type="submit" value="Search">

</p>
</form>

1. No 'target' on 'form'
2. '<element />' on single tag elements for XHTML not HTML
3. IMG and INPUT elements need to be contained withing block element,
e.g., P, DIV, PRE, H# ADDRESS

Thanks, thats perfect :)

Paul
 
R

Rguy84

Uh grey, haven't you ran code through W3C validator lately? it says
what to do. Like my hit service gives url's with ampersands. This is a
no no, W3C says that and says I should change the & to &amp; for
example.
GreyWyvern said:
And lo, Adam Strickland didst speak in
alt.html,alt.macromedia.dreamweaver,alt.www.webmaster:

[top posting fixed]
The only thing i know is to close your img tag:

<img src="images/search.gif" alt="search" width="70" height="13">

like so:

<img src="images/search.gif" alt="search" width="70" height="13" />

Like William said, these are not allowed in HTML 4.01. All of these
should be removed from the original code given.

My question is, the OP gave us this block of code that didn't validate:

So who told him/her/it that it didn't validate? I don't know of any
"validation" tool which fails to also supply you with information helpful
in fixing the problem.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- http://www.greywyvern.com/orca#sear - Orca Search: Full-featured spider
and site-search engine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top