Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > vailidation fail?

Reply
Thread Tools

vailidation fail?

 
 
Paul Watt
Guest
Posts: n/a
 
      01-17-2006
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>


 
Reply With Quote
 
 
 
 
William Tasso
Guest
Posts: n/a
 
      01-17-2006
Fleeing from the madness of the jungle
Paul Watt <> 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.
--
William Tasso

Save the drama
for your Mama.
 
Reply With Quote
 
 
 
 
Adam Strickland
Guest
Posts: n/a
 
      01-17-2006
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" />

"Paul Watt" <> wrote in message
news:dqj6tn$gl8$...
> 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>
>



 
Reply With Quote
 
GreyWyvern
Guest
Posts: n/a
 
      01-17-2006
And lo, Adam Strickland didst speak in
alt.html,alt.macromedia.dreamweaver,alt.www.webmaster:

[top posting fixed]

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

>
> 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:

>> <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>


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
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      01-17-2006
Paul Watt wrote:

> 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


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Paul Watt
Guest
Posts: n/a
 
      01-19-2006

"Jonathan N. Little" <> wrote in message
news:43cd3058$0$8273$.. .
> Paul Watt wrote:
>
>> 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
>
>
> --
> Take care,
>
> Jonathan
> -------------------
> LITTLE WORKS STUDIO
> http://www.LittleWorksStudio.com


Thanks, thats perfect

Paul


 
Reply With Quote
 
Rguy84
Guest
Posts: n/a
 
      01-30-2006
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 wrote:
> And lo, Adam Strickland didst speak in
> alt.html,alt.macromedia.dreamweaver,alt.www.webmaster:
>
> [top posting fixed]
>
> > "Paul Watt" <> wrote...
> >
> >> Hi,
> >> The following code fails validation when used with a html 4.01 strict
> >> DTD.
> >> why and how can i fix it?
> >> TIA
> >> Paul

> >
> > 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:
>
> >> <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>

>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57