Forum Moderators: open
We know we can use labels like this:
<label for="myeditbox">please enter:</label>
<input type="text" id="myeditbox" name="stupidname" /> So that the client knows that that specific label belongs to that form element.
But how should this be done with radio buttons?
As I allready use a seperate label for each different value for the radio buttons like this:
<label><input type="radio" name="radio" value="0" />No</label>
<label><input type="radio" name="radio" value="1" />Yes</label> Am I right to conclude that I should do that like this:
<label for="yesnoradio">Yes or No?</lable>
<label><input type="radio" name="yesnoradio" id="yesnoradio" value="0" />No</label>
<label><input type="radio" name="yesnoradio" id="yesnoradio" value="1" />Yes</label> note: I'm programming xhtml1.1 strict code only; so it has to validate!
tnx people :)
<span>Yes or No?</span>
<label><input type="radio" name="yesnoradio" id="yesnoradio0" value="0" />No</label>
<label><input type="radio" name="yesnoradio" id="yesnoradio1" value="1" />Yes</label>
I'm trying to understand the reason you feel you need to have a label wrapped around both radio buttons?