Name validation for add and edit