You can do this in following manner. I've not tested the code thoroughly. Hope it will work for you.
<script language="javascript" type="text/javascript">
$(function() {
$( "#user_name" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "report_student_result.php",
dataType: "json",
data: {
request_type: "ajax",
op: "get_student_names",
class_id: $('#class_id').val(),
section_id: $('#section_id').val(),
name_startsWith: request.term
},
success: function( data ) {
response(
$.map(data, function(item) {
return {
label: item.full_name,
value: item.full_name
}
})
);
}
});
},
minLength: 2,
select: function( event, ui ) {
if(ui.item) {
$(event.target).val(ui.item.value);
}
return false;
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
});
</script>