vailidation fail?

Discussion in 'HTML' started by Paul Watt, Jan 17, 2006.

  1. Paul Watt

    Paul Watt Guest

    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>
     
    Paul Watt, Jan 17, 2006
    #1
    1. Advertising

  2. 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.
     
    William Tasso, Jan 17, 2006
    #2
    1. Advertising

  3. 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>
    >
     
    Adam Strickland, Jan 17, 2006
    #3
  4. Paul Watt

    GreyWyvern Guest

    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
     
    GreyWyvern, Jan 17, 2006
    #4
  5. 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
     
    Jonathan N. Little, Jan 17, 2006
    #5
  6. Paul Watt

    Paul Watt Guest

    "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
     
    Paul Watt, Jan 19, 2006
    #6
  7. Paul Watt

    Rguy84 Guest

    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
     
    Rguy84, Jan 30, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    4
    Views:
    2,175
    Ralf Hildebrandt
    Sep 8, 2003
  2. Jürgen Exner

    Re: CGI Perl "use CGI" statement fail

    Jürgen Exner, Jul 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,618
    Jürgen Exner
    Jul 31, 2003
  3. Jussi Mononen

    Math::Pari test fail on Compaq OSF1 5.1b

    Jussi Mononen, Jan 2, 2004, in forum: Perl
    Replies:
    0
    Views:
    709
    Jussi Mononen
    Jan 2, 2004
  4. Charles Shannon Hendrix

    REGEX: capturing on optional groups which fail

    Charles Shannon Hendrix, Jun 14, 2004, in forum: Perl
    Replies:
    0
    Views:
    571
    Charles Shannon Hendrix
    Jun 14, 2004
  5. Wenjie

    if (f() != FAIL) or if (FAIL != f())?

    Wenjie, Jul 28, 2003, in forum: C Programming
    Replies:
    3
    Views:
    480
    E. Robert Tisdale
    Jul 31, 2003
Loading...

Share This Page