I'm making a form with checkboxes and radiobuttons I use the value as price, which I calculate with a script so I get the total price of the selected checkboxes and radiobuttons.
<script>
function calcscore() {
score = 0;
$(".calc:checked").each(function () {
score += Number($(this).val());
});
$("#price").text(score.toFixed(2));
$("#sum").val(score)
}
$().ready(function () {
$(".calc").change(function () {
calcscore()
});
});
</script>
<input type="radio" id="1" value="40" class= "calc" name = "780143050"> Gezichtsbehandeling (incl.)<br>
<input type="radio" id="2" value="40" class = "calc" name = "780143050"> Massage<br>
<input type="radio" id="3" value="75" class = "calc" name = "780143050"> beide
<span id="output"></span><input type="hidden" name="sum" id="sum" value="0">
<p>Totaal extra's : € <span id="price">0</span>
I have the following PHP
test.php
<?php
echo("keuze : " . $_POST['780143050'] . "<br />
");
?>
I in my php script the value and the ID. How can I echo the ID of the selected radiobutton?