you can write all your javascripts in on tag.
<script>
function getdoctor(val) {
$.ajax({
type: "POST",
url: "../get_doctor.php",
data:'specilizationid='+val,
success: function(data){
// i assume that your data on ajaxs success has 2 properties in the object
$("#input1").val(data.item1);
$("#input2").val(data.item1);
}
});
}
</script>