473,473 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jun 27 '08 #1
3 3181
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)
http://rastallian.blogspot.com/
Jun 27 '08 #2
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>Submit</legend>.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 27 '08 #3
On Jun 17, 8:12 pm, "Jukka K. Korpela" <jkorp...@cs.tut.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>Submit</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
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Ian Rastall | last post by:
I'm curious as to the group's feelings about using the <fieldset> and <legend> tags around elements other than <form> elements ... I wrote a small test file:...
3
by: Trent | last post by:
Hello, I have a <fieldset> in a <TD>. I want the fieldset to be as high as the TD. Setting the fieldset's height to 100% works in IE. Opera ignores it. Firefox & Netscape 7.1 give it the...
0
by: Anne van Kesteren | last post by:
Ok, here it goes. Originally I submitted this proposal to www-style. Since I don't get feedback there, I think I missed a few (maybe a lot) of points. Proposal:...
2
by: Marek Mänd | last post by:
Can the legend element in fieldset be placed automatically by Mozilla horizontally in the middle of fieldset?
2
by: luke | last post by:
I'm trying to use an image as a background for a text input box. <form> <fieldset><input type="text" name ="blah" class="cheese"></fieldset> </form> I'm using this code as part of my css to...
6
kestrel
by: kestrel | last post by:
i cant get my fieldset to work properly i have a form with two fieldsets, separating the required forms and optional but the one around the optional isnt working heres what i have: ...
1
by: Nate12o6 | last post by:
Hey guys, i am having trouble with getting the heights corrected on my fieldset. Right now i have 2 table cells side by side. And inside of each there is a field set. The fieldset to the right...
2
by: Vajrala Narendra | last post by:
hi all, am working on a project in asp.net in designing means in source code i used fieldsets. while design time it is appering normally, but in run time the positions of that fildsets were...
1
by: BlueG | last post by:
I wrote simple code for expandable/collapsable fieldsets. You can try it yourselves: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.