I am using this ***javascript*** and ***php*** code to pass value of ***input*** field on ***keyup***.
which is working fine. But i want to add some radio buttons and unable to pass their value. THe code I am using is :

**HTML**

```
<div class="header-right">
<input style="width:150px;" id="searchData" type="text"><br> 
<input type="radio" id="advsrch" name="advsrch" value="name">Name
<input type="radio" id="advsrch" name="advsrch" value="city">City
</div>

```

**Javascript**

```
$(document).ready(function(){

    var advsrch = "";
var selected = $("input[type='radio'][name='advsrch']:checked");
    advsrch = selected.val();

$('#results').html('<p style="padding:5px;">Enter a search term to start filtering.</p>');

  $('#searchData').keyup(function() {

 var searchVal = $(this).val();
      if(searchVal !== '') {

         $.get('search_data/search-data.php?searchData='+searchVal+advsrch, function(returnData) {
             if (!returnData) {
                $('#results').html('<p style="padding:5px;">Search term entered does not return any data.</p>');
            } else {
                $('#results').html(returnData);
            }
        });
    } else {
        $('#results').html('<p style="padding:5px;">Enter a search term to start filtering.</p>');
    }

    });

});

```

and then getting value in **PHP**

```
$param = $_GET["searchData"];
$advsrch = $_GET["advsrch"];

```

and here i am getting value of ***searchData*** but not ***advsrch***