I’m running… but console.log(ajax_call(info)); keeps being displayed as undefined.
function autosuggest_results (info){
if (info.length > 1)
{
var with_field = document.getElementById('users');
var with_auto_id = document.getElementById('with_auto');
var search_emp_id = document.getElementById('search_employees');
var users_list = document.getElementsByName('with_uid[]');
if(with_auto_id){
var with_auto = with_auto_id;
}else{
var with_auto = search_emp_id;
}
ajax_call(info);
console.log(ajax_call(info));
}
else
{
hide();
}
}
function ajax_call(info){
var with_u_list = prev_picked();
ajax.get('/assets/ajax/associates_search.php?info=' + info + '&sid=' + hex_md5(sess_id()) + '&list=' + with_u_list, function(resp)
{
var search = eval('(' + resp + ')');
show();
var with_auto_id = document.getElementById('with_auto');
var search_emp_id = document.getElementById('search_employees');
if(with_auto_id){
var with_auto = with_auto_id;
}else{
var with_auto = search_emp_id;
}
if(search.length > 0){
fill_list(search);
}else{
removeChildren(with_auto);
var no_res_div = document.createElement('div');
no_res_div.className = 'as_no_res';
appendText(no_res_div, 'No associates found for \\'' + info + '\\'. He/she may already have been added.');
with_auto.appendChild(no_res_div);
}
//console.log(search);
return search;
});
}