Fieldset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    Fieldset

    Hello,

    I am creating a form. It has a few labels, inputs and a submit button.
    Should I place the button inside the same fieldset as the inputs and
    labels? Or in a different fieldset?

    Or maybe I should use the following approach:

    1. If the form has only one fieldset then the submit button would be
    inside the same fieldset has the inputs and labels.
    2. If the form has more than one fieldset then the button to submit
    the entire form would be placed in a new fieldset.

    This is just an idea.

    What is the best approach?

    Thanks,
    Miguel
  • Lance Manyon

    #2
    Re: Fieldset

    On Tue, 17 Jun 2008 09:58:00 -0700 (PDT), shapper wrote:
    I am creating a form. It has a few labels, inputs and a submit button.
    Should I place the button inside the same fieldset as the inputs and
    labels? Or in a different fieldset?
    I would place the whole form in one fieldset.

    Hope you're well,
    Ian
    --
    It is better to have loafed and lost than
    never to have loafed at all. (James Thurber)
    Blogger ist ein Veröffentlichungs-Tool von Google, mit dem du ganz einfach deine Gedanken der Welt mitteilen kannst. Mit Blogger kannst du problemlos Texte, Fotos und Videos in deinem persönlichen Blog oder deinem Team-Blog veröffentlichen.

    Comment

    • Jukka K. Korpela

      #3
      Re: Fieldset

      Scripsit shapper:
      I am creating a form. It has a few labels, inputs and a submit button.
      Should I place the button inside the same fieldset as the inputs and
      labels? Or in a different fieldset?
      On the practical side, it does not matter much.

      The fieldset element is, in principle, an element for logical grouping.
      Typically, you wrap a set of radio buttons and their labels inside a
      fieldset, when they "work together", specifying a "one-of-many" choice.
      Or you could use a fieldset that contains fields for a person's name
      (e.g., surname, first name, middle name) and their labels; the fieldset
      corresponds then to the concept "a person's name". However, such logical
      grouping does not matter much to browsers, except for special rendering
      of the entire fieldset. This is somewhat unfortunate, since you don't
      always want that rendering, and it is difficult to kill it.

      Moreover, a fieldset element must have a legend element. Often it is
      easy and natural to write one, but not always. (However,
      <legend></legendcan be used; it is valid, even if it does not sound
      very logical.)

      So I would group labels and inputs if they are logically related, and I
      would not put a submit button there. I would use just <div><input
      type="submit" ...></div>.
      Or maybe I should use the following approach:
      >
      1. If the form has only one fieldset then the submit button would be
      inside the same fieldset has the inputs and labels.
      It sounds a bit illogical, and the rendering might be somewhat
      misleading to people who are already used to seeing fieldset display for
      interrelated fields.
      2. If the form has more than one fieldset then the button to submit
      the entire form would be placed in a new fieldset.
      No reason to put the button in a fieldset, and there would be no natural
      legend for it. _If_ you had several submit buttons (which is usually a
      bad idea for certain practical reasons), then they might be grouped into
      a fieldset, with e.g. <legend>Submi t</legend>.

      --
      Jukka K. Korpela ("Yucca")


      Comment

      • shapper

        #4
        Re: Fieldset

        On Jun 17, 8:12 pm, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
        Scripsit shapper:
        >
        I am creating a form. It has a few labels, inputs and a submit button.
        Should I place the button inside the same fieldset as the inputs and
        labels? Or in a different fieldset?
        >
        On the practical side, it does not matter much.
        >
        The fieldset element is, in principle, an element for logical grouping.
        Typically, you wrap a set of radio buttons and their labels inside a
        fieldset, when they "work together", specifying a "one-of-many" choice.
        Or you could use a fieldset that contains fields for a person's name
        (e.g., surname, first name, middle name) and their labels; the fieldset
        corresponds then to the concept "a person's name". However, such logical
        grouping does not matter much to browsers, except for special rendering
        of the entire fieldset. This is somewhat unfortunate, since you don't
        always want that rendering, and it is difficult to kill it.
        >
        Moreover, a fieldset element must have a legend element. Often it is
        easy and natural to write one, but not always. (However,
        <legend></legendcan be used; it is valid, even if it does not sound
        very logical.)
        >
        So I would group labels and inputs if they are logically related, and I
        would not put a submit button there. I would use just <div><input
        type="submit" ...></div>.
        >
        Or maybe I should use the following approach:
        >
        1. If the form has only one fieldset then the submit button would be
        inside the same fieldset has the inputs and labels.
        >
        It sounds a bit illogical, and the rendering might be somewhat
        misleading to people who are already used to seeing fieldset display for
        interrelated fields.
        >
        2. If the form has more than one fieldset then the button to submit
        the entire form would be placed in a new fieldset.
        >
        No reason to put the button in a fieldset, and there would be no natural
        legend for it. _If_ you had several submit buttons (which is usually a
        bad idea for certain practical reasons), then they might be grouped into
        a fieldset, with e.g. <legend>Submi t</legend>.
        >
        --
        Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
        I use fieldsets since I might have grouping in my forms and I think
        fieldset is a good way to do that ... If i don't want to display a
        legend I can always do:

        fieldset legend {display: none;}

        But I think the grouping is useful in some cases.

        In relation to the buttons, that was what I was thinking: to place a
        div INSIDE the form to contain the buttons ...

        Wrapping the buttons in a fieldset, even if more than one (for example
        Submit and Cancel), does not make much sense to me ...

        Thanks,
        Miguel


        Comment

        Working...