Solution to JavaScript Form Validation Exercise