Varios radio buttons
Publicado por Yoel (2 intervenciones) el 24/04/2020 05:54:11
Hola, tengo la siguente situación: estoy usando varios radio button en una misma página pero me está sucediendo que cuando selecciono un se me borran los demas del mismo nombre. El nombre no se lo puedo cambiar porque quiero capturar el valor de todos al mismo tiempo. Aquí les dejo el código para ver si me pueden ayudar. Gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<H5>SPOUSE</H5>
<label class="radio inline">
<input type="radio" name="coveragedep[]" id="optionsRadios3" value="1" <?php echo ($row[0]['coverrage'] == 1)?'checked':''; ?> ><b>Coverage Yes </b>
</label>
<label class="radio inline">
<input type="radio" name="coveragedep[]" id="optionsRadios4" value="2" <?php echo ($row[0]['coverrage'] == 2)?'checked':''; ?>><b>Coverage No </b>
</label>
<label class="radio inline">
<input type="radio" name="sexodep[]" id="optionsRadios3" value="1" <?php echo ($row[0]['sexo'] == 1)?'checked':''; ?>><b>Sex M </b>
</label>
<label class="radio inline">
<input type="radio" name="sexodep[]" id="optionsRadios4" value="2" <?php echo ($row[0]['sexo'] == 2)?'checked':''; ?>><b>Sex F </b>
</label>
<H5>DEPENDE 1</H5>
<label class="radio inline">
<input type="radio" name="coveragedep[]" id="optionsRadios5" value="1" <?php echo ($row[1]['coverrage'] == 1)?'checked':''; ?>><b>Coverage Yes </b>
</label>
<label class="radio inline">
<input type="radio" name="coveragedep[]" id="optionsRadios6" value="2" <?php echo ($row[1]['coverrage'] == 2)?'checked':''; ?>><b>Coverage No </b>
</label>
<label class="radio inline">
<input type="radio" name="sexodep[]" id="optionsRadios7" value="1" <?php echo ($row[1]['sexo'] == 1)?'checked':''; ?>><b>Sex M </b>
</label>
<label class="radio inline">
<input type="radio" name="sexodep[]" id="optionsRadios8" value="2" <?php echo ($row[1]['sexo'] == 2)?'checked':''; ?>><b>Sex F </b>
</label>
Valora esta pregunta


0