This version uses the following regular expressions to check for a valid name:
/^[a-zA-Z]+$/
/^[a-zA-Z]+([\-][a-zA-Z]+)?$/