CS 389 Web Programming Fall 2018 

Project #5/#6: Forms


  • Learn JavaScript Form Processing


Write a "funny" name generator using JavaScript. Allow the user to enter their name in an html form. When they press a button, the page will display their new "funny" name.

Such generators are popular ways of generating funny names. Examples include pirate names and musical group names.

Require the user to enter at two word name (FIRST LAST) space delimited. Only accept english characters (no punctuation, accented characters, or foreign alphabets). Verify all this using regular expressions. If the user does not enter this, report an error.

Once the input has been verified, compute the name based on an array of possible choices based on the first letter of the first name and last name entered. For example a first name starting with "A" might get converted into Alligator-head.

Finally, once the name has been computed, output it to the webpage.

Create a link from your main page to your name generator.

Validate your webpage and CSS using the following validators:

  1. W3C Markup Validation Service
  2. AChecker


  1. CSS Reference from w3schools.

Copyright © 2018, David A. Reimann. All rights reserved.