4
I created a table that is the summary of all my previous calculations and in this table I created a field where I put a radial input to be able to select one of the calculated options. I need to identify which input was clicked, using id, to proceed with the calculations. I am using PHP.
Table:
<table class="table table-bordered">
<caption> Calculation </caption>
<thead>
<tr>
<th class="text-center">Cam number</th>
<th class="text-center">Space between cam</th>
<th class="text-center">FOV</th>
<th class="text-center">Overlap</th>
<th class="text-center">Height</th>
<th class="text-center">Pixels</th>
<th class="text-center">Selected</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center"><?php echo"$ncam" ?></td>
<td class="text-center"><?php echo"$dist mm" ?></td>
<td class="text-center"><?php echo"$fov mm" ?></td>
<td class="text-center"><?php echo"$ov mm" ?></td>
<td class="text-center"><?php echo"$alt mm" ?></td>
<td class="text-center"><?php echo"$sensor" ?></td>
<td class="text-center"><input type="radio" name="row-3" id="l1" data-col="1"></td>
</tr>
<tr>
<td class="text-center"><?php echo"$ncam1" ?></td>
<td class="text-center"><?php echo"$dist1 mm" ?></td>
<td class="text-center"><?php echo"$fov1 mm" ?></td>
<td class="text-center"><?php echo"$ov1 mm" ?></td>
<td class="text-center"><?php echo"$alt1 mm" ?></td>
<td class="text-center"><?php echo"$sensor" ?></td>
<td class="text-center"><input type="radio" id="l2" ></td>
</tr>
</tbody>
</table>
Then the idea was to select one or the other option and the calculations were "automatic".
Thank you.
I made the change here :Script test using radio imput
Here the script works, but if you put it in my document it stops working, I don’t understand why.
Right now I’m trying to move the radial input variable to a PHP variable and I’m having an error. Right now I don’t know where this error might come from, because I’m passing the variable correctly:
$escolha = $_POST['radio'];
I don’t know if the problem is due to having two Forms on the same page, I just have to solve this problem to finish. Thank you
input uses the same name for all radio’s so only one can be selected and after Submit is sent the value of that selected radio
– Laranja Mecânica
No one has any idea how I can do it?
– Pedro Lima