div within fieldset - validation error advice

Discussion in 'HTML' started by RobM, Nov 14, 2004.

  1. RobM

    RobM Guest

    Hiya Folks

    Have a form - tableless - whose syntax I've used from a web example; uses
    divs around each label and assoc input field which is positioned on each
    line. Looks fine, trouble is, the validator doesnt like the div in the
    fieldset ( I assume thats the prob "document type does not allow element
    "DIV" here").

    URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html

    Scuse the CSS file - its a WIP and contains a lot of other stuff that will
    be cut down (yeah OK, I should start from scratch! And stuff starting with X
    ignore). Anyfrog; Q is - do you think I should replace the divs (well, got
    to get it validating!!) with spans with a class that is added to the excerpt
    from my CSS file
    (http://users.bigpond.net.au/snootfrog/wip/framework/vol00.css) below.

    label, fieldset div.cr p {
    margin: 0;
    display: block;
    width: 5em;
    float: left;
    }

    Thanks
    Rob
    Melbourne (brrrr.. reaches for single malt)
    RobM, Nov 14, 2004
    #1
    1. Advertising

  2. RobM

    RobM Guest

    "RobM" <> wrote in message
    news:AiEld.35826$...
    > Hiya Folks
    >

    Q is - do you think I should replace the divs (well, got
    > to get it validating!!) with spans with a class that is added to the

    excerpt
    > from my CSS file
    > (http://users.bigpond.net.au/snootfrog/wip/framework/vol00.css) below.
    >
    > label, fieldset div.cr p {
    > margin: 0;
    > display: block;
    > width: 5em;
    > float: left;
    > }


    Sorry - I copied the wrong bit of CSS; the section I mean is below (reaches
    for more malt...)

    fieldset div {
    clear: both;
    margin: .1em 0;
    position: relative;
    }
    RobM, Nov 14, 2004
    #2
    1. Advertising

  3. RobM

    brucie Guest

    brucie, Nov 14, 2004
    #3
  4. "RobM" <> wrote:

    > the validator doesnt like the
    > div in the fieldset ( I assume thats the prob "document type does not
    > allow element "DIV" here").


    Your assumption is wrong. You are supposed to check HTML syntax from
    references and specifications, instead of making guesses.

    > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html


    The syntax of <fieldset> requires that the first element is a <legend>
    element. That's why the validator says <div> is not allowed - it wouldn't
    allow any other element either, except for <legend>.

    You _could_ use
    <legend>Please enter your User Id and Password to log in</legend>
    or maybe
    <legend>Information for logging in</legend>

    On the other hand, maybe you don't need <fieldset> at all. After all,
    it's for grouping fields, and now all the fields would appear inside one
    group. So you could have just a few <div> elements inside the <form>.

    > Scuse the CSS file


    The CSS file is absolutely irrelevant to the validation issue.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Nov 14, 2004
    #4
  5. RobM

    RobM Guest

    "brucie" <> wrote in message
    news:zf7acv6biosa$...
    > In alt.html RobM said:
    >
    > > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html

    >
    > · no need to use tabindex
    > · don't use autocomplete off, let the visitor make that decision for
    > themselves.
    >
    > http://moreshit.usenetshit.info/login-form-thingy.shit
    >
    >
    > --
    > the facts and opinions expressed by brucies
    > l i t t l e v o i c e s
    > are not necessarily the same as those held by brucie.


    Thanks Brucie.. The label/inputs arent on the same line but I'll have a go
    at adjusting with the direction you've sent me.

    > · don't use autocomplete off, let the visitor make that decision for
    > themselves.


    I agree about the user preferences... 2 minds about this (its the only thing
    that normally stops my stuff validating). I only put it on the login page
    for security so IE doesnt provide the last person's login on the same PC
    when they start entering the userId field. A valid exception to this rule?
    (thinks....) I guess that is up to the user to look after their own
    security, and its something I could warn about on the page.

    Cheers
    RobM
    Melbourne
    RobM, Nov 14, 2004
    #5
  6. RobM

    brucie Guest

    In alt.html RobM said:

    > Thanks Brucie..


    kissy

    > The label/inputs arent on the same line


    that was deliberate so they lined up and looked all pretty

    > but I'll have a go at adjusting with the direction you've sent me.


    remove display:block; from the <input>s inside the <label>s leave it on
    for the submit <input>

    >> · don't use autocomplete off, let the visitor make that decision for
    >> themselves.


    > I agree about the user preferences...


    good

    > I only put it on the login page for security so IE doesnt provide the
    > last person's login on the same PC when they start entering the
    > userId field. A valid exception to this rule?


    no, stop trying to control what you think the visitor wants/needs.

    > (thinks....) I guess that is up to the user to look after their own
    > security,


    yes.

    > and its something I could warn about on the page.


    if you like but they should already know.


    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 14, 2004
    #6
  7. RobM

    RobM Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns95A16FD16ADD0jkorpelacstutfi@193.229.0.31...
    > "RobM" <> wrote:
    >
    > > the validator doesnt like the
    > > div in the fieldset ( I assume thats the prob "document type does not
    > > allow element "DIV" here").

    >
    > Your assumption is wrong. You are supposed to check HTML syntax from
    > references and specifications, instead of making guesses. [1]


    > The syntax of <fieldset> requires that the first element is a <legend>
    > element. That's why the validator says <div> is not allowed - it wouldn't
    > allow any other element either, except for <legend>.
    >
    > You _could_ use
    > <legend>Please enter your User Id and Password to log in</legend>
    > or maybe
    > <legend>Information for logging in</legend>
    >
    > On the other hand, maybe you don't need <fieldset> at all. After all,
    > it's for grouping fields, and now all the fields would appear inside one
    > group. So you could have just a few <div> elements inside the <form>.
    >
    > > Scuse the CSS file

    >
    > The CSS file is absolutely irrelevant to the validation issue.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >



    Thanks Jukka/Yucca for the input, appreciated.

    [1] Yes thats true, wasnt being lazy, I normally do - I stopped there and
    thought I'd see what people thought about what I was trying to do.

    I'm going to trim it without the fieldsets etc and see how I go. Sounds
    smaller and better, especially if I want to keep the form graphical layout
    (Brucie's example is great, but the legend may clash with my form border
    page style). You're right, perhaps I dont need it.

    Thanks for the time spent with the reply
    Rob
    RobM, Nov 14, 2004
    #7
  8. RobM

    Kris Guest

    In article <AiEld.35826$>,
    "RobM" <> wrote:

    > Have a form - tableless - whose syntax I've used from a web example; uses
    > divs around each label and assoc input field which is positioned on each
    > line. Looks fine, trouble is, the validator doesnt like the div in the
    > fieldset ( I assume thats the prob "document type does not allow element
    > "DIV" here").
    >
    > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html


    <span class="formTitle1">Please enter your User Id and Password to log
    in</span>

    Should be

    <legend>Please enter your User Id and Password to log in</legend>

    Fix the heading structure on your page: <h1>Login page</h1>, <p>Only
    authorised...</p>

    <form ... autocomplete="off">

    My browser has this great feature of autocompleting forms, even password
    fields if I allow it, so I won't have to remember all my different
    credentials. You however try to turn that off, would I be a visitor of
    your site.

    > label, fieldset div.cr p {
    > margin: 0;
    > display: block;
    > width: 5em;
    > float: left;
    > }


    When an element is being floated, it automatically becomes block level.
    The display property is not needed in this case.

    --
    Kris
    <> (nl)
    Kris, Nov 14, 2004
    #8
  9. RobM

    RobM Guest

    "Kris" <> wrote in message
    news:4all.nl...
    > In article <AiEld.35826$>,
    > "RobM" <> wrote:
    >
    > > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html

    >
    > <span class="formTitle1">Please enter your User Id and Password to log
    > in</span>
    >
    > Should be
    >
    > <legend>Please enter your User Id and Password to log in</legend>
    >
    > Fix the heading structure on your page: <h1>Login page</h1>, <p>Only
    > authorised...</p>
    >
    > <form ... autocomplete="off">
    >
    > My browser has this great feature of autocompleting forms, even password
    > fields if I allow it, so I won't have to remember all my different
    > credentials. You however try to turn that off, would I be a visitor of
    > your site.
    >
    > > label, fieldset div.cr p {
    > > margin: 0;
    > > display: block;
    > > width: 5em;
    > > float: left;
    > > }

    >
    > When an element is being floated, it automatically becomes block level.
    > The display property is not needed in this case.
    >
    > --
    > Kris
    > <> (nl)


    Dank U Kris.

    The heading structure - thats interesting... "Login Page" should be <h1>
    instead of the name of the site (which is what I already have in h1)? And
    yes, 'only authorised...' is not a heading.

    Point taken about the autocomplete.

    Thanks for the float info.

    Cheers
    Rob
    RobM, Nov 14, 2004
    #9
  10. RobM

    Kris Guest

    In article <OPFld.35986$>,
    "RobM" <> wrote:

    > > > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html


    > > Fix the heading structure on your page: <h1>Login page</h1>, <p>Only
    > > authorised...</p>


    > The heading structure - thats interesting... "Login Page" should be <h1>
    > instead of the name of the site (which is what I already have in h1)?


    I didn't notice you already had a H1. In that case the H1 I mentioned
    becomes a H2.

    I am however one of those who disagrees on putting a H1 on website
    logos/names. If you would compare it to structuring a report in a
    program like MS Word, one would rarely put the company's name in the
    main heading.

    > And
    > yes, 'only authorised...' is not a heading.


    If you want that text to be more obvious, more 'important' or stressed
    out, using the STRONG element would be a solution.

    --
    Kris
    <> (nl)
    Kris, Nov 14, 2004
    #10
  11. RobM

    RobM Guest

    Re: div within fieldset - validation error advice (use of headings)

    "Kris" <> wrote in message
    news:4all.nl...
    > In article <OPFld.35986$>,
    > "RobM" <> wrote:
    >
    > > > > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html

    >>

    > I am however one of those who disagrees on putting a H1 on website
    > logos/names. If you would compare it to structuring a report in a
    > program like MS Word, one would rarely put the company's name in the
    > main heading.
    >
    > --
    > Kris
    > <> (nl)


    Agreed... I started to wonder, as every page will have the same <h1>, not
    good for searching etc. The only thing that's lead me to leave it though, is
    it will never be indexed as all these pages are JSP and will be served
    dynamically. Still, I guess to be pedantic (or correct? *grin*) perhaps the
    current h1 should just be classed span/div text and the name of the page
    (e.g. login page, enquiries... etc) should be the main heading - which
    _will_ change. This agrees with your Word comparison.

    Thanks for the input (now I sound like something out of that movie Short
    Circuit!)
    Rob
    RobM, Nov 14, 2004
    #11
  12. RobM

    RobM Guest

    "brucie" <> wrote in message
    news:zn6gxwbdviup$...
    > In alt.html RobM said:
    >
    > > Thanks Brucie..

    >
    > kissy


    Stop that... there's strange lip marks on my whisky glass...

    >
    > > The label/inputs arent on the same line

    >
    > that was deliberate so they lined up and looked all pretty
    >
    > > but I'll have a go at adjusting with the direction you've sent me.

    >
    > remove display:block; from the <input>s inside the <label>s leave it on
    > for the submit <input>


    Thanks - blimey that now looks concise (not uploaded).

    Cheers
    Rob


    > --
    > the facts and opinions expressed by brucies
    > l i t t l e v o i c e s
    > are not necessarily the same as those held by brucie.
    RobM, Nov 14, 2004
    #12
  13. RobM

    RobM Guest

    "brucie" <> wrote in message
    news:zn6gxwbdviup$...
    > In alt.html RobM said:
    >
    > > Thanks Brucie..

    >
    > kissy
    >
    > > The label/inputs arent on the same line

    >
    > that was deliberate so they lined up and looked all pretty
    >
    > > but I'll have a go at adjusting with the direction you've sent me.

    >
    > remove display:block; from the <input>s inside the <label>s leave it on
    > for the submit <input>
    >


    Hmmm... dont want to be a pain, but anyone know how to line up the input
    fields (sort of like 2 columns, labels and inputs). That was what I was
    originally doing with the divs. Shame, coz this does look
    simpler...http://users.bigpond.net.au/snootfrog/wip/brucieform.html
    (although we these folks help my original effort now validates and is much
    cleaner.. I still have divs around the label/input pairs tho until I know
    how to line up the inputs (another page will have quite a few fields so will
    look better if lined up).

    thks to Brucie for the example
    Cheers
    Rob
    Melbourne
    RobM, Nov 14, 2004
    #13
  14. RobM

    RobM Guest

    > Hmmm... dont want to be a pain, but anyone know how to line up the input
    > fields (sort of like 2 columns, labels and inputs). That was what I was
    > originally doing with the divs. Shame, coz this does look
    > simpler...http://users.bigpond.net.au/snootfrog/wip/brucieform.html
    > (although we these folks help my original effort now validates and is much
    > cleaner.. I still have divs around the label/input pairs tho until I know
    > how to line up the inputs (another page will have quite a few fields so

    will
    > look better if lined up).
    >
    > thks to Brucie for the example
    > Cheers
    > Rob
    > Melbourne
    >


    unless it's just OE (I should use Opera's reader, I used it for browsing) I
    dont see the URL clearly - sorry. Here goes again.

    http://users.bigpond.net.au/snootfrog/wip/brucieform.html

    Rob
    RobM, Nov 14, 2004
    #14
  15. RobM

    brucie Guest

    In alt.html RobM said:

    > Hmmm... dont want to be a pain, but anyone know how to line up the input
    > fields (sort of like 2 columns, labels and inputs).


    http://moreshit.usenetshit.info/login-form-version-two-thingy.shit

    not supported by IE (and i don't care)

    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 14, 2004
    #15
  16. RobM

    Kris Guest

    Re: div within fieldset - validation error advice (use of headings)

    In article <U7Gld.36012$>,
    "RobM" <> wrote:

    > > > > > URL is http://users.bigpond.net.au/snootfrog/wip/common/test.html
    > >>

    > > I am however one of those who disagrees on putting a H1 on website
    > > logos/names. If you would compare it to structuring a report in a
    > > program like MS Word, one would rarely put the company's name in the
    > > main heading.


    > Agreed... I started to wonder, as every page will have the same <h1>, not
    > good for searching etc. The only thing that's lead me to leave it though, is
    > it will never be indexed as all these pages are JSP and will be served
    > dynamically.


    Search engine bots don't know and don't care. They get HTML,
    well-formed, valid HTML even (after you fix the errors). Don't expect
    your website not to be indexed after you bring the word out. Unless
    ofcourse you make it impossible for them to index it.

    > Still, I guess to be pedantic (or correct? *grin*) perhaps the
    > current h1 should just be classed span/div text and the name of the page


    Could be. There is no LOGO element, so I suppose DIV is good enough.

    > (e.g. login page, enquiries... etc) should be the main heading - which
    > _will_ change. This agrees with your Word comparison.


    In reality, most people don't use structural styling for their Word
    documents; they simply enlarge font size for selected text and set it to
    bold. The same practice as the way most (clueless) web designers make
    websites.

    --
    Kris
    <> (nl)
    Kris, Nov 14, 2004
    #16
  17. RobM

    RobM Guest

    "brucie" <> wrote in message
    news:...
    > In alt.html RobM said:
    >
    > > Hmmm... dont want to be a pain, but anyone know how to line up the input
    > > fields (sort of like 2 columns, labels and inputs).

    >
    > http://moreshit.usenetshit.info/login-form-version-two-thingy.shit
    >
    > not supported by IE (and i don't care)
    >
    > --
    > the facts and opinions expressed by brucies
    > l i t t l e v o i c e s
    > are not necessarily the same as those held by brucie.


    Style guru !
    Ta.
    RobM, Nov 14, 2004
    #17
  18. RobM

    Adrienne Guest

    Re: div within fieldset - validation error advice (use of headings)

    Gazing into my crystal ball I observed Kris <>
    writing in news:4all.nl:

    > In reality, most people don't use structural styling for their Word
    > documents; they simply enlarge font size for selected text and set it to
    > bold. The same practice as the way most (clueless) web designers make
    > websites.
    >


    I've always used structural styling for word processor documents. I
    started with Multimate, and then Word Perfect for DOS. It was easier to
    put structure into a document than a lot of bolds and font sizes, just like
    it's easier to do with HTML. Even though I use Windows now, I still use
    structural styling, it's easier.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    Adrienne, Nov 15, 2004
    #18
  19. RobM

    rf Guest

    rf, Nov 16, 2004
    #19
  20. RobM

    brucie Guest

    In alt.html rf said:

    >> http://moreshit.usenetshit.info/login-form-version-two-thingy.shit


    > Why are all your links giving me a 404 brucie?


    i've already done the housekeeping and deleted them. everyone except
    some people who ran run off to their private county retreat have already
    seen them.

    --
    the facts and opinions expressed by brucies
    l i t t l e v o i c e s
    are not necessarily the same as those held by brucie.
    brucie, Nov 16, 2004
    #20
    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. =?Utf-8?B?SSBhbSBTYW0=?=

    <fieldset> tag

    =?Utf-8?B?SSBhbSBTYW0=?=, May 24, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    509
    =?Utf-8?B?SSBhbSBTYW0=?=
    May 24, 2005
  2. =?Utf-8?B?a3N0cml5aG9u?=

    Getting Drillthrough result from pivottable fieldset

    =?Utf-8?B?a3N0cml5aG9u?=, Jul 23, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,277
    =?Utf-8?B?a3N0cml5aG9u?=
    Jul 25, 2005
  3. luke

    <fieldset> & CSS

    luke, Mar 12, 2005, in forum: HTML
    Replies:
    2
    Views:
    1,461
    Disco Octopus
    Mar 14, 2005
  4. Replies:
    7
    Views:
    59,067
    Steve Pugh
    Mar 15, 2006
  5. Peter Smit

    Fieldset not showing

    Peter Smit, Jan 20, 2007, in forum: HTML
    Replies:
    9
    Views:
    4,462
    Peter Smit
    Jan 20, 2007
Loading...

Share This Page