无法通过Ajax添加到数据库

when the submit button is clicked the id of the selected medal should be returned and inserted in a database via Ajax. But this doesn't seem to work. Does someone know what's going on or what i've done wrong? This is the form:

<form action="" method="post">
<?php

            while($medal = $allMedals->fetch_assoc())
                {
                    echo "<img src='" . $medal['imagepath'] . "' />";
                    echo "<input type='radio' name='radio' class='selectmedal' value='" . $medal['medalid'] . "' />";
                }

?>
            <input type='submit' value='Nominate' id='submitknop' onclick='geklikt()'/>
</form>

And this is the function geklikt:

function geklikt(){
        alert($("#selectmedal").val());
        var medalid = $(".selectmedal").val();
        var data = { selectmedal:medalid };

        $.ajax({
            type: "POST",
            url: "ajax/medal_save.php",
            data: data
        }).done(function( msg ) {
            $(".feedback").text(msg.message);
        });

        return false;

The alert is being shown but shows the same id with every medal that is selected (id 3). This is the code from the medal_save.php:

<?php
    include('../classes/Nomination.class.php');

    if(!empty($_POST['selectmedal']))
    {
        $nomination = new Nomination();
        $nomination->Medal = $_POST['selectmedal'];
        try
        {
            $nominate->Save();
            $feedback ['message'] = "Nomination succes!";
            $feedback ['status'] = "success";
        }
        catch(Exception $e)
        {
            $feedback ['message'] = $e->getMessage();
            $feedback ['status'] = "error"; 
        }   
    }
    else
    {
        $feedback ['message'] = "Please select a medal";
        $feedback ['status'] = "error";     
    }
    header('Content-type: application/json');
    echo json_encode($feedback);
?>

Thanks in advance!

it looks like you need to get the selected radiobutton

 $('input[name=radioinputname]:checked', '#yourformid').val();

that is if you are not actually saying you want the attribute id ( ?) if so use

 $('input[name=radioinputname]:checked', '#yourformid').attr("id");

so

<form action="" method="post" id="myradioform">
   <?php

        while($medal = $allMedals->fetch_assoc())
            {
                echo "<img src='" . $medal['imagepath'] . "' />";
                echo "<input type='radio' name='radioinputname' 
                      class='selectmedal' value='" . $medal['medalid'] . "' />";
            }

      ?>
        <input type='submit' 
         value='Nominate' id='submitknop' onclick='geklikt()'/>
  </form>

<script type="text/javascript">
   function geklikt(){
    alert($("#selectmedal").val());

    /* here */
    var medalid = $('input[name=radioinputname]:checked', '#myradioform').val();

   /* or if you actually meant to you want the attribute id */
   /*
  var medalid =  $('input[name=radioinputname]:checked', '#myradioform').attr("id");
 */

    var data = { selectmedal:medalid };

    $.ajax({
        type: "POST",
        url: "ajax/medal_save.php",
        data: data
    }).done(function( msg ) {
        $(".feedback").text(msg.message);
    });

    return false;
  }
  </script>