I'm attempting to get the value of a radio button field via Ajax, but it returns only 'undefined'.
I'm using:
function fetch_data(id,type)
{
$.ajax({
type: "POST",
async: false,
url: "fetch_data.php",
data: "id="+id+"&type="+type,
success: function(msg){
$("#div1").html(msg);
}
});
}
<select name="data1" id="data1"
onchange="fetch_data(this.value,document.getElementsById('radio1').value"
style=" width:150px;">
<div id="div1"></div>
will replace with "fetch_data.php" page div