reduce code duplication, fix parse error, prevent page reload on hitting...

... enter while changing the display name - refs #8004 

@PVince81 @butonic @icewind1991 @bantu THX