Implementing the javascript to perform player name actions