Poll Markup. Where should I place the question?

S

shapper

Hello,

I am creating a poll using the following markup:

<p>Question</p>
<form>
<fieldset>
<ol>
<li><input id="option1" type="radio" name="Answer 1"
value="Answer 1" /></li>
<li><input id="option2" type="radio" name="Answer 2"
value="Answer 2" /></li>
</ol>
</fieldset>
<fieldset class="Action">
<input id="Vote" type="submit" value="Vote" name="Action.Vote"/>
</fieldset>
</form>

I think my markup is ok but should I place the Question inside a
legend in the fieldset?
<form>
<fieldset>
<legend>Question</legend>
<ol>
<li><input id="option1" type="radio" name="Answer 1"
value="Answer 1" /></li>
<li><input id="option2" type="radio" name="Answer 2"
value="Answer 2" /></li>
</ol>
</fieldset>
....

What do you think?

Thanks,
Miguel
 
A

Adrienne Boswell

Gazing into my crystal ball I observed shapper <[email protected]>
writing in @a19g2000pra.googlegroups.com:
Hello,

I am creating a poll using the following markup:

<p>Question</p>
<form>
<fieldset>
<ol>
<li><input id="option1" type="radio" name="Answer 1"
value="Answer 1" /></li>
<li><input id="option2" type="radio" name="Answer 2"
value="Answer 2" /></li>
</ol>
</fieldset>
<fieldset class="Action">
<input id="Vote" type="submit" value="Vote" name="Action.Vote"/>
</fieldset>
</form>

I think my markup is ok but should I place the Question inside a
legend in the fieldset?
<form>
<fieldset>
<legend>Question</legend>
<ol>
<li><input id="option1" type="radio" name="Answer 1"
value="Answer 1" /></li>
<li><input id="option2" type="radio" name="Answer 2"
value="Answer 2" /></li>
</ol>
</fieldset>
...

What do you think?

Thanks,
Miguel

I would maybe do something like:

<form>
<fieldset><legend>Part I</legend>
<label>Question 1</label>
<ol>
<li><input id="option1" type="radio" name="Answer 1" value="Answer
1" /></li>
<li><input id="option2" type="radio" name="Answer 2" value="Answer
2" /></li>
</ol>
<label>Question 2</label>
......
</fieldset>
<fieldset><legend>Part II</legend>
....
</fieldset>
</form>
 
S

shapper

Gazing into my crystal ball I observed shapper <[email protected]>
writing in @a19g2000pra.googlegroups.com:









I would maybe do something like:

<form>
<fieldset><legend>Part I</legend>
<label>Question 1</label>
  <ol>
     <li><input id="option1" type="radio" name="Answer 1" value="Answer
1" /></li>
     <li><input id="option2" type="radio" name="Answer 2" value="Answer
2" /></li>
  </ol>
<label>Question 2</label>
.....
</fieldset>
<fieldset><legend>Part II</legend>
...
</fieldset>
</form>

And if the poll has only one question?

Your suggestion makes sense if I would have a questionnaire with many
sections and each section having many questions.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed shapper <[email protected]>
writing in 64g2000hsm.googlegroups.com:
And if the poll has only one question?

Your suggestion makes sense if I would have a questionnaire with many
sections and each section having many questions.

Then I would not use a fieldset at all. The fieldset element is for
breaking up a form into sections, you are correct. The legend element
is for the legend of the fieldset. The element you are looking for is
the label element.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top