My radio input is repeating

0

My input radio only on this line 3 is repeating the others not. Here is an image for better understanding:

Excerptofthecodewhereitrepeats...

<divclass="section4">
        <td>Cumprimento de Horário (pontualidade dos horários de viagens).</td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="A"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="B"> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="C"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="D"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="E"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="F"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="G"/> </td>
        </div>

PHP code snippet:

 $section4 =isset($_POST["horario"])?$_POST["horario"]:"[nao informado]";
    
asked by anonymous 29.04.2016 / 14:11

2 answers

1

% of your radios are different. Or remove all or space at all.

How are you?

<div class="section4">
        <td>Cumprimento de Horário (pontualidade dos horários de viagens).</td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="A"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="B"> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="C"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="D"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name=" horario" value="E"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="F"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="G"/> </td>
        </div>

How should I stay:

<div class="section4">
        <td>Cumprimento de Horário (pontualidade dos horários de viagens).</td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="A"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="B"> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="C"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="D"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="E"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="F"/> </td>
        <td WIDTH=9 align="center"> <input type="radio" name="horario" value="G"/> </td>
        </div>

Note that I removed the spaces, and everything was name .

  

Just a reminder, if you are using a table, there is no need for this name="horario" , nor is it normal to do this.

    
29.04.2016 / 14:16
0

It is the name that some have a space and others do not. Change to.:

<tr class="section4">
    <td>Cumprimento de Horário (pontualidade dos horários de viagens).</td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="A"/> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="B"> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="C"/> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="D"/> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="E"/> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="F"/> </td>
    <td WIDTH=9 align="center"> <input type="radio" name="horario" value="G"/> </td>
 </tr>
    
29.04.2016 / 14:16