Your function validateUserDetails return no value, she just execute an asynchronous function.
The asynchronous function return true or false, but nothing for catching it.
It's like this :
function validateUserDetails(){
// asynchronous function
$.ajax({...});
return undefined;
}
If you try console.log(trueOrFalse(bool));
you will see "true" or "false", but you can't use "return" into asynchronous function. You must do something into success function, who use "data" (log, or another function)