You can limit it on input with that javascript, which will take care of most of the people who use a long name by mistake, not knowing what it will affect. You could also just limit the field maxlength, which will prevent people from entering more characters than you want. Either of those client side ways can be circumvented by someone who is really determined, but really, you just want to prevent people from doing it be accident.
You could also just add overflow:hidden
to the display of that field in your style.css and have the displaye truncated rather than have it mess up your layout.