14.1.1. Exercises: Input Masks

  1. Build and run the MaskTestForm application and use it to explore the following inputMask values.

    1. "AV99e77"

    2. "\AV99e77"

  2. Provide an input mask that accepts the following (and use the form to test your answers):

    1. Only valid Social Security numbers in the format: 123-45-6789

    2. Only Canadian postal codes in the format: 2K3 Y4W (alternating numbers and letters)

    3. Only U.S. Zip+4 codes in the format: 02114-5678

    4. Only U.S. phone numbers in the format: (234)345-4567

    5. Only U.S. phone numbers in the format: 1-123-234-5678

  3. Can you make the "1-" at the beginning of the last U.S. phone number format optional (i.e., so that it also accepts phone numbers like 234-456-5678)?

[ fromfile: validation.xml id: inputmask-ex ]