Forum Moderators: not2easy
Say you want to have a question and 2 radio buttons for yes & no
Do widgets make you happy?______O Yes______O No
Would it be appropriate to do this and then use css to put everything on the same line?
<fieldset>
<legend>Do widgets make you happy?</legend>
<label for="yes">Yes</label><input name="happy_widgets" id="yes" type="radio" value="Yes">
<label for="no">No</label><input name="happy_widgets" id="no" type="radio" value="No">
</fieldset>
Or is that the wrong way to go about it/inproper use of <legend>?
I think that this is a perfect use of legend..
I don't know mind you, I haven't validated or tested but the possibilities of nesting fieldset and legend tags then becomes apparent..
My thoughts:
You can use one fieldset/legend to surround the whole form, the use subsets of fields (fieldsets) with their appropriate legends to split the form into areas.
I also use <label> to line up forms (table style) and using fieldset/legend the way you describe you could then specify different class names on your fieldsets to allow for <label>'s that have radio buttons as opposed to <input> fields..
Will try an example and see if validates..
but I like it!
Suzy