/!--will somone help me with this code ..... notice that there are three radio buttons on top but it is not on the code.. please help on the ordered list never mine the name i can manage it... ty --!/

<html>

<body>
<table>
<th>what happen<th>
<tr>
<td><li>When presented with a problem, many different solutions occur to me without much 

effort.</li></td>
<td><input type="radio" name="choose" value="a" id="a"/></td>
<td><input type="radio" name="choose" value="b"id="b"/></td>
<td><input type="radio" name="choose" value="c"id="c"/></td>
</tr>

<tr>
<td><li> Noticing minor details is one of my strengths.</li></td>
<input type="radio" name="choose" value="a"/></td>
<input type="radio" name="choose" value="b"/></td>
<input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li> As a general rule, I am on the lookout for different ways to approach a 

problem.</li></td>
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>  I often find myself trying to remember what I was about to do next.</li></td> 
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>  It irritates me when others in my group perform better than I do. </li></td>
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li> I find it difficult to decide which things are most important when I have a lot of 

tasks to do. </li></td>  
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>  I often find myself falling behind in things that need to be done.</li></td>
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>  I hate changing environments (moving, changing job/school, traveling).</li></td>
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>   I am easily discouraged.</li></td>  
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>

<tr>
<td><li>    I pay careful attention to small things when I'm completing a task.</li> </td>
<td><input type="radio" name="choose" value="a"/></td>
<td><input type="radio" name="choose" value="b"/></td>
<td><input type="radio" name="choose" value="c"/></td>
</tr>            
</ol>   
</table>
</body>
</html>

Dani AI

Generated

Good troubleshooting by and thanks to for following up. After fixing the immediate markup errors, a few practical changes will make this kind of questionnaire work reliably and be accessible to everyone.

Make each question its own radio group. The browser groups radios by the name attribute, so every row needs a different name (for example q1, q2, ...). Use unique id values and pair them with <label for="..."> so clicking the text toggles the radio and screen readers announce the option. Group the three choices with a fieldset and legend for clear semantics and keyboard focus.

Example pattern for one question:

<fieldset>
  <legend>1. When presented with a problem, many different solutions occur to me</legend>
  <input type="radio" id="q1_a" name="q1" value="a">
  <label for="q1_a">A</label>

  <input type="radio" id="q1_b" name="q1" value="b">
  <label for="q1_b">B</label>

  <input type="radio" id="q1_c" name="q1" value="c">
  <label for="q1_c">C</label>
</fieldset>

Layout and semantics tips: pick either a list (<ol><li>) or a table for visual alignment, but avoid mixing list items inside table cells. If you use a table for layout, keep the question text in one cell and the radios in aligned cells, and use <thead>/<tbody> and proper <th> for headers. Use meaningful value attributes so form processing is simple (for example value="often", value="sometimes").

Final checks: run the page through the W3C validator, test keyboard-only navigation and a screen reader, and inspect form submit data to confirm each question posts its own field. For reference on semantics and accessibility see MDN's pages on radio inputs and fieldsets: Radio inputs on MDN and fieldset/legend on MDN.

Recommended Answers

All 2 Replies

Your table header doesn't have a closing tag (just add a slash to the closing TR), but that's not really affecting anything.

You also have a closing OL tag, but I don't see an opening one. Also, doesn't matter since it won't affect the numbering of the LI tags due to their locations in the code. If you just want bullets and don't care about them being numbered, then you can omit the OL tag anyway.

Considering the only line which is missing the radio buttons, I looked there. You've omitted the opening TD tag on all 3 lines inside the second table row. Fix that and your problem is solved.

Thank you for your help, I think i should be careful in my coding.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.