While there's an "Ok" button as soon as you enter the textfield, it seems like leaving the menu is what triggers the namechange. I am wondering whether this could be weird for the player. I'd say it'd be okay to send it to the server right away, it's not that much traffic. This way for example, a player could change his name and directly ask their friends what they think about the name. Now they'd ask and their friends would be confused saying "your name didn't" change.