I am trying to make this ajax request function work but netbeans is giving a warning that the following function does not always return a value. Can anyone please help.
function fpform(){
    var response='';
    var fpemail = $('#frgtpwd').val();
    //var fpemail = document.getElementById('frgtpwd').value;
    if (fpemail == ""){
        $('span#fperror').text("insert your emal address");
        //document.getElementById('fperror').innerHTML = "Insert your email address";
        return false;
    } else {
        var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(fpemail)==false) { 
            $('span#fperror').text("Email address is not in valid format");
            //document.getElementById('fperror').innerHTML = "Email address is not in valid format";
            return false;
        } else {
            $("#loader").html('<img src="images/ajax-loader.gif" />');
            $.post("forgot_password_process.php", {
                email:fpemail
            }, function(response){
                response = response.trim();
            }).success(function () {
                if (response == 'yes'){
                    $("#fperror").html('<font color="green"><b>Your password has been reset now and emailed to you </b></font>');
                    $("#loader").hide('<img src="images/ajax-loader.gif" />');
                    return true;
                } else {
                    alert("your email address was not found");
                    $("#loader").hide('<img src="images/ajax-loader.gif" />');
                    $("#fperror").html('<font color="black"><b> Email address was not found in database!</b></font>');
                    return false;
                } 
            });
        }
    }
}
 
     
     
     
    