Validate radio buttons with php using the ID not the NAME: | SoloLearn: Learn to code for FREE!

0

Validate radio buttons with php using the ID not the NAME:

I have 3 button radios but the name of the radios I bring from the bd (I bring the name), until then I have no problems, the question is that since I do not have a name that I wrote manually I can not pick them up by post (if I print the varibles that arrived by post I receive the value without problems). the case is that if I do it with getElementId () how would that value change to php (I tried it with ajax but it did not work). I would greatly appreciate this help. <tr> <td><?php echo $registroAsistencia[0]; ?></td> <td><?php echo $registroAsistencia[1]; ?></td> <td><?php echo $registroAsistencia[2]; ?></td> <!--<td><label><input type='radio' name='<?php //echo $registroAsistencia[1]; ?>' id="presente" value='presente'> Presente</label></td> <td><label><input type='radio' name='<?php //echo $registroAsistencia[1]; ?>' id="ausente" value='ausente'> Ausente</label></td> <td><label><input type='radio' name='<?php //echo $registroAsistencia[1]; ?>' id="excusa" value='excusa' > Excusa</label></td>--> <td><input type='hidden' name='asistencia[]' value='<?php echo $registroAsistencia[1]; ?>'><label><input type='radio' name='<?php echo $registroAsistencia[1]; ?>' id="presente" value='presente'> Presente</label></td> <td><input type='hidden' name='asistencia[]' value='<?php echo $registroAsistencia[1]; ?>'><label><input type='radio' name='<?php echo $registroAsistencia[1]; ?>' id="ausente" value='ausente'> Ausente</label></td> <td><input type='hidden' name='asistencia[]' value='<?php echo $registroAsistencia[1]; ?>'><label><input type='radio' name='<?php echo $registroAsistencia[1]; ?>' id="excusa" value='excusa'> Excusa</label></td> <input type ="hidden" name ="idRegistrado" id="idRegistrado" value ="<?php echo $registroAsistencia[0]; ?>"> </tr> in the post what I get is this / Training ( [bSend] = & gt; // the button [diana] = & gt; I presented [luis] = & gt; absent [nose] = & gt; excuse [juan] = & gt; excuse ) What I need is to know how to collect this dat

7/8/2019 3:16:25 PM

Alvaro Blanco

0 Answers

New Answer