Re: Page does not validate

Discussion in 'HTML' started by Thomas Mlynarczyk, Feb 21, 2012.

  1. Alfred Molon schrieb:

    > The first error comes from the Google javascript:
    > Line 31, Column 38: there is no attribute "ASYNC"
    > And I guess there is nothing I can do here.


    Just remove the offending attribute.

    > But the other two errors probably can be corrected. How?


    A form element must contain block level elements. These should ideally
    be fieldsets but they require a legend element and are a bit difficult
    to style, so use a simple div. The "Results per page" should go in a
    label element (not required for validation, but semantically better):

    <form class="form1" method="post" action="./">
    <div>
    <label>
    Results per page:
    <select name="npicspage" onchange="...">
    <option value="10">10</option>
    <option value="25">25</option>
    <option value="50" selected>50</option>
    <option value="100">100</option>
    <option value="200">200</option>
    </select>
    </label>
    </div>
    </form>

    Since you're not using XHTML, a simple <option ... select> will do, no
    need for the (IMHO awkward) selected="selected". The class="form1" would
    better be put in the <form> tag (avoids the ugly repetition on every
    option; change your CSS selector to .form1 option and consider a more
    semantic name than "form1"). Also, the value attributes may be
    unnecessary since they are exactly the same as the option text.

    Greetings,
    Thomas


    --
    Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
    (Coluche)
     
    Thomas Mlynarczyk, Feb 21, 2012
    #1
    1. Advertising

  2. Alfred Molon schrieb:

    > I don't get you here. What do you mean with <option ... select>?


    My error. I meant <option value="..." select*ed*>...</option>

    > But how...? I tried placing class="form1" into the form tag and it
    > didn't work. How should the CSS be modified?


    In your CSS, you have (at line 144)

    option.form1 { font-size: 11px }

    This means "all option elements having the class form1" get the font
    size 11px.

    That should then become

    ..form1 option { font-size: 11px }

    meaning "all option elements contained within an element having the
    class form1" get the style.

    Greetings,
    Thomas

    --
    Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
    (Coluche)
     
    Thomas Mlynarczyk, Feb 22, 2012
    #2
    1. Advertising

  3. Thomas Mlynarczyk schrieb:

    > In your CSS, you have (at line 144)

    Oops. That should read line 114.


    --
    Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
    (Coluche)
     
    Thomas Mlynarczyk, Feb 22, 2012
    #3
  4. Alfred Molon <> writes:

    > In article <ji16e3$thj$>, Thomas Mlynarczyk says...
    >> Since you're not using XHTML, a simple <option ... select> will do, no
    >> need for the (IMHO awkward) selected="selected".

    >
    > I don't get you here. What do you mean with <option ... select>?


    I think it's a typo. In XHTML you have to write
    <... selected="selected"> but in HTML, <... selected> is enough.

    >> The class="form1" would
    >> better be put in the <form> tag (avoids the ugly repetition on every
    >> option; change your CSS selector to .form1 option

    >
    > But how...? I tried placing class="form1" into the form tag and it
    > didn't work. How should the CSS be modified?


    Where you currently have

    option.form1 { ... }

    you'd write

    form.form1 option { ... }

    http://www.w3.org/TR/CSS2/selector.html#descendant-selectors

    --
    Ben.
     
    Ben Bacarisse, Feb 22, 2012
    #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. sviau
    Replies:
    5
    Views:
    514
    Steven Cheng[MSFT]
    Feb 10, 2004
  2. Replies:
    16
    Views:
    1,925
    Jukka K. Korpela
    Mar 19, 2007
  3. charles cashion

    code does not validate

    charles cashion, Dec 27, 2007, in forum: HTML
    Replies:
    14
    Views:
    658
    Beauregard T. Shagnasty
    Dec 28, 2007
  4. Replies:
    4
    Views:
    216
  5. Jukka K. Korpela

    Re: Page does not validate

    Jukka K. Korpela, Feb 22, 2012, in forum: HTML
    Replies:
    7
    Views:
    686
    Beauregard T. Shagnasty
    Feb 22, 2012
Loading...

Share This Page