The best practice is to validate the name on both the client and the server. Client-side validation can give users immediate feedback but can be disregarded or gamed. Because it stops malicious data from entering your database, server-side validation is crucial for security and data integrity.