when i call this function I am not getting a return value to use in my other function that called it. I know this request works as I can use alert() and see the value is there. Any ideas would be greatly appreciated.
function GetRepName(InputStr1){
var name = '';
$.post("getrepname.php", {queryString: ""+InputStr1+""}, function(data){
if(data.length >0) {
$('#Results'+InputStr1).html(data);
name = data;
}
});
return name;
}
The posts I have read so far suggest having the variable defined in the outer function and then returned but this doesn't seem to be working. do I need to add some code that will wait for the value to be returned before issuing the return statement?