function getPlayerByLastName(lastname){
for(var i = 0; i < player.length; i++) {
if(player[i].lastname.toLowerCase() == lastname.toLowerCase()) {
return player[i].firstname +" "+ player[i].lastname +" "+ player[i].team +" "+ player[i].pposition +" "+ player[i].averagepoints;
}
}
return "No Match";
}
searchButton.onMouseDown = function(){
returnField = getPlayerByLastName(nameField);
};
The only thing in my code that is not included is and array I created.
Thanks.