The answer is; you don't.
Always ask the question you actually mean to ask.
Frequently someone's /name/ is part of a mailing ADDRESS. You can, and maybe should, limit this to a individual lines. However the only way to be SURE is to give an actual freeform multi-line input box, like a textarea.
If you want a string to greet someone as, ask for that, and store it separately.
If you want a title to display within a directory listing, accept that.
Generally, do not decompose things for your users, EXCEPT possibly client side while populating form elements for their convenience (and verification/correction).