Assignments -- Week 1

1. Basic Assignment

Type your full name here:
(First, Middle, Last)

Type your age here:
(Integer numbers only)



2. Advanced Assignment


Select your own
background color:

Note: I tried separating the validation into two functions -- one for names and one for age. These two functions worked fine if I removed focus from one text box BUT I did not click on the other one. If I removed focus from one box to the other, the focus() for name and for age got into an endless loop. I'd get an alert from the names function that I needed to reenter that data, but focus was already on the age text box. Once I cancelled the alert, the focus was changed back to the names box, which triggered an alert from the age text box. I never could figure out how to avoid this loop, so I gave up and did it the way the book shows, checking both names and ages in a single function.