CSc 4998. Web Programming
Spring 2006, Assignment 3 (Javascript)
Due: February 24, 2006 (Monday)
Code the following three problems:
- Develop an HTML page with embedded Javascript code that will show two textboxes
labeled Word and Value, and a Submit button. The user will enter an English word
such as "attitude" in the textbox labeled "Word". Upon clicking the Submit button, the
second text box labeled "Value" should be populated (by your Javascript code) with the
value of the word just entered. The value of a word is defined as the sum of the
values of the individual letters of the word with value of "a" being 1, "b" being 2
etc. Upper and lower case letters have the same value. Also, alert the user if they enter
any character other than the letters A/a through Z/z.
- Update your Assignment 2 code (only the screen that shows the games and the
scores for a particular date for update purposes) so that all Error Checking is done in
Javascript instead of server side error checking. In particular the following errors
should be checked:
- For a particular game, the user should not be able to submit just one
of the scores (they should enter both home and visitor scores or none).
- Each score entered must be a valid positive integer or a zero (0).
- Develop an HTML page with embedded Javascript code as well as some server side
Java servlets that allows the users to choose a city within a state within a region.
Assume that there are 5 regions: Northeast, Southeast, Midwest, West, and Northwest.
For each region, assume there are 3 to 5 states (e.g. Midwest may have Iowa, Illinois,
Michigan, Ohio, and Kansas). For each state assume there are 3 to 4 cities (for
example Iowa may have Ames, Iowa City, Rapid City, and Mason).
Initially the user should see a Web page with only one "Select" list of regions.
Upon choosing a region the second "Select" list of states for the chosen region should
show up on the Web page. Next, upon choosing a state the third "Select" list of
cities within the selected state should show up on the Web page along with
a submit button labeled "Find Weather". Finally, when a city is chosen and the "Find Weather"
button is clicked, a new HTML page should be displayed with the name of the region,
state, and city that were chosen.
To make the problem a bit simpler and also realistic, let us assume that the regions,
states, and cities are stored in a database table weather.sql.
You still need some Javascript, but now you will also write at least one servlet (maybe three)
to process some of the requests by performing database queries.