You really should have a label with each input, and the for/id pair is needed for accessibility. (It’s nice for anyone, as it means you can click on the label to activate the radio.)
Seems OK to me, but perhaps await other replies. (Same applies to the following …)
2.) What are you supposed to call your ID’s??
wotevah you like.
3.) What should “name” be across several groups of 3-Radio Buttons?
Should it be “requestResponse1”, “requestResponse2”, “requestResponse3” ?
Again, it sup to you.
4.) What should my “id” be across several groups of 3-Radio Buttons?
I assume each one must be unique on my page, right?
Again, up to you, but yes, the rule that they must be unique still applies.
5.) Is it okay to have a <fieldset> around my entire Form and also around each Radio-Button-Set?
I’m not totally sure if nesting fieldsets is against the rules or not, but I suspect it is, and I’d definitely say don’t do that. The fieldset is just to create logical groups of form fields. So I’d think that it would just confuse things badly to nest them.
Don’t feel bad about not getting the difference between NAME and ID right away – a lot of people even after being told a dozen times still don’t get it… drives me nutters when working with certain people’s code.
One thing a friend pointed out to me just a couple weeks ago I never noticed you may find interesting/useful – if you have a proper for/id relationship between a label and it’s input, clicking on the label has the same effect as clicking on the input. I never even noticed that behavior, and it works all the way back to IE 5.
Be darned. That’s the first thing I noticed about it … or was told about it. I almost always just click on the label when filling out forms—or just tab through them, which has the same effect.
Not something I’d even think of – when I want to select an element I click on the element, not the text next to it… clicking on the text next to it doesn’t make any sense to me.
But it must to some people… I guess if the element is really small (checkbox/radio button) and you suck with a mouse… maybe…
Nested fieldsets are valid (with legends of course) and are sometimes useful for creating sub groups within a logical group.
Have a look at this very very old (and extreme) example (excuse the use of p elements as I don’t use them any more to wrap form elements). It is perhaps even easier to see the usefulness of this form if you turn styles off (use the option at the top) and then the structure becomes very clear.
However, in most simple forms you probably would not need to nest very often.
Everywhere else other than web pages you have always been able to click on the text in order to select a checkbox or radio button. HTML forms were the ones missing that standard functionality prior to the introduction of the label tag. That was the first thing I noticed about HTML forms - that the radio button text was broken in early browsers because it didn’t select the button for you when you clicked on it
Markup looks fine – apart from the bug triggering comments (in particular comments between LI is just /FAIL/) the multiple ‘let’s open and close php on every line’ are rubbish, but again I’m the guy who would like to see <?php and ?> removed from PHP altogether so… It’s just sloppy coding.
Also since those elements are all alike, I’d put the options in a list and iterate the list to output them.