Re: Unusual Validation Question

Discussion in 'HTML' started by Jukka K. Korpela, Aug 27, 2010.

  1. Mojo wrote:

    > So here is the page being validated:
    >
    > http://boldplan.com/s/tiny/lYa852
    >
    > I've noticed two errors that are a little odd.


    The errors are rather simple. Check the validator's explanations for these
    types of errors.

    > 1) The "no attribute" errors don't come up if the page is purely in
    > one .html document. I split it up into header.php and footer.php and
    > now I get these errors.


    What matters is the HTML document sent to a client (browser, validator,
    indexing robot, whatever). The PHP code used to generate it is invisible to
    the outside world. It does not matter any more than the type of editor you
    used to create it (as long as the HTML document is the same), the color of
    the pants you used when composing the document, etc.

    > Doesn't quite make sense nor why there is a
    > question about this page being html transitional.


    What question? The page itself identifies itself that way. And the page or
    poorly authored if I may say, with all the real stuff (the content) in
    typewriter style (monospace font, preformatted). Such presentation is
    pointlessly outdated, worse than even most web pages in the early 1990s. So
    I don't really know why you are worried about validation. The site needs
    redesign, not nitpicking and polishing.

    > 2) The function of the search produces two errors but I'm not sure how
    > else one uses links that go back and forth to the same search without
    > using the same ID for the previous and next search entry.


    The question is somewhat obscure, but the errors of using the same id twice
    seem to stem from using the same id (and name) for a hidden field and for a
    real input field. First, why would a hidden field need an id? Second, if the
    form handler is reasonable, there is no need for the hidden field. It is
    sufficient to have the real fields, with suitable initial values id needed.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 27, 2010
    #1
    1. Advertising

  2. Jukka K. Korpela

    Mike S Guest

    On 8/27/2010 4:41 PM, Mojo wrote:
    > On Fri, 27 Aug 2010 20:46:06 +0300, "Jukka K. Korpela"
    > <> wrote:
    >
    >> Mojo wrote:
    >>
    >>> So here is the page being validated:
    >>>
    >>> http://boldplan.com/s/tiny/lYa852
    >>>
    >>> I've noticed two errors that are a little odd.

    >>
    >> The errors are rather simple. Check the validator's explanations for these
    >> types of errors.
    >>
    >>> 1) The "no attribute" errors don't come up if the page is purely in
    >>> one .html document. I split it up into header.php and footer.php and
    >>> now I get these errors.

    >>
    >> What matters is the HTML document sent to a client (browser, validator,
    >> indexing robot, whatever). The PHP code used to generate it is invisible to
    >> the outside world. It does not matter any more than the type of editor you
    >> used to create it (as long as the HTML document is the same), the color of
    >> the pants you used when composing the document, etc.
    >>
    >>> Doesn't quite make sense nor why there is a
    >>> question about this page being html transitional.

    >>
    >> What question? The page itself identifies itself that way. And the page or
    >> poorly authored if I may say, with all the real stuff (the content) in
    >> typewriter style (monospace font, preformatted). Such presentation is
    >> pointlessly outdated, worse than even most web pages in the early 1990s. So
    >> I don't really know why you are worried about validation. The site needs
    >> redesign, not nitpicking and polishing.
    >>
    >>> 2) The function of the search produces two errors but I'm not sure how
    >>> else one uses links that go back and forth to the same search without
    >>> using the same ID for the previous and next search entry.

    >>
    >> The question is somewhat obscure, but the errors of using the same id twice
    >> seem to stem from using the same id (and name) for a hidden field and for a
    >> real input field. First, why would a hidden field need an id? Second, if the
    >> form handler is reasonable, there is no need for the hidden field. It is
    >> sufficient to have the real fields, with suitable initial values id needed.

    >
    > 1) The "no attribute" errors don't come up if the page is purely in
    > one .html document. If split up into header.php and footer.php, the
    > error appears. That is the only issue. It has nothing at all to do
    > with the aesthetic appearance of the middle content area, which I
    > clearly know needs to be done next (it's only a matter of putting the
    > new tags into the style sheet now.) If it makes you feel better, strip
    > out the middle content area aka 1995 and the error still exists which
    > I cannot explain. The validator says that this error occurs usually
    > when a doc is strict yet the element is transitional.
    >
    > 2) I'll check out stripped the IDs but the forms are there to go back
    > and forth between the results and it seemed as if they were necessary.
    > Perhaps, as you insist, they are not.


    http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

    7.5.2 Element identifiers: the id and class attributes

    .....The id attribute assigns a unique identifier to an element (which
    may be verified by an SGML parser). For example, the following
    paragraphs are distinguished by their id values:

    <P id="myparagraph"> This is a uniquely named paragraph.</P>
    <P id="yourparagraph"> This is also a uniquely named paragraph.</P>
    Mike S, Aug 28, 2010
    #2
    1. Advertising

  3. Mojo wrote:

    > 1) The "no attribute" errors don't come up if the page is purely in
    > one .html document.


    You fullquoted my reply, including my short quotation of your text, and now
    you are repeating that text. I think you now need to find some tutorial that
    explains what HTML and PHP are, because you clearly don't understand it.

    The page as sent to the validator, or to a browser, _is_ one HTML document.

    Open the page http://boldplan.com/s/tiny/lYa852 in a browser, and do a View
    / Source. That's what the server actually sends, and that's what the
    validator deals with. It is quite irrelevant whether PHP was used to
    generate it or whether it was actually typed by a pink Martian who thought
    he was composing a Vogonian poem.

    > If split up into header.php and footer.php, the
    > error appears.


    There are no such files visible to the outside world. I'm not saying that
    they exist in your imagination only. They exist in the _server_ you use, but
    the server, quite properly, refuses to send them to anyone. (If a URL ending
    with .php is requested for, the server does _not_ reply by sending a PHP
    file, because the server has been programmed to execute PHP program code and
    deliver the result.)

    > It has nothing at all to do
    > with the aesthetic appearance of the middle content area, which I
    > clearly know needs to be done next (it's only a matter of putting the
    > new tags into the style sheet now.)


    It's a matter of using <pre> markup, not a matter of styling.

    > If it makes you feel better, strip
    > out the middle content area aka 1995 and the error still exists


    Of course, but the error is irrelevant in practice (browsers just ignore
    attributes they don't recognize), whereas the poor formatting matters a lot.

    > 2) I'll check out stripped the IDs but the forms are there to go back
    > and forth between the results and it seemed as if they were necessary.
    > Perhaps, as you insist, they are not.


    Using the same id twice is fundamentally wrong, violating the very idea of
    id attributes (which is to assign a _unique_ identifier to an element) and
    may have unpredictable effects. What do you expect to achieve by using id
    attributes for hidden fields, and with the same values as for visible
    fields?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 28, 2010
    #3
  4. Mojo wrote:

    > What is irrelevant is the entire set of replies you've provided.


    Well, you also wrote that you understood the uniqueness requirement for id
    attributes, now that I explained it second time.

    > What is happening is happening for a reason,


    That's an interesting Weltanschauung but doesn't really help you here.

    > The appropriate answer, instead of a
    > dissertation on the universe is "I don't know why this behaviour is
    > occurring."


    No it is not the appropriate answer. You still haven't asked a meaningful
    question at all, and you still haven't understood what your problem is. We
    cannot know your problem because you have been talking about some PHP files
    that are not visible to the outside world.

    Your remaining issue with validation is that you have two attributes that
    are not defined in the DTD that your document refers to. The answer that
    they should be removed appears to be too trivial to be stated. Apparently
    you don't know how to remove them, otherwise you wouldn't be asking. In any
    case it has to deal with the software you use to _generate_ the pages. If
    you don't know how it works, how could others know that?

    In any case, those attributes are ignored by browsers, so why do you care?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 28, 2010
    #4
    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. Neo Geshel
    Replies:
    2
    Views:
    349
    Flinky Wisty Pomm
    Feb 14, 2006
  2. earthwormgaz

    Unusual scope question

    earthwormgaz, Apr 26, 2007, in forum: C++
    Replies:
    3
    Views:
    286
    Salt_Peter
    Apr 26, 2007
  3. Guest

    An unusual question...

    Guest, Apr 17, 2011, in forum: Python
    Replies:
    2
    Views:
    131
    sturlamolden
    Apr 17, 2011
  4. Guest

    Re: An unusual question...

    Guest, Apr 18, 2011, in forum: Python
    Replies:
    3
    Views:
    182
    Grant Edwards
    Apr 18, 2011
  5. Colin Colin
    Replies:
    2
    Views:
    105
    Colin Colin
    Apr 5, 2004
Loading...

Share This Page