Web 程式設計、技術與應用(CS3431):作業 3

張智星


Demo 日期:2001/10/15-16

[以下是給甲組同學的作業]

The goal of this homework is to perform form validation, which is considered to be one of the most important missions of JavaScript. Specifically, you are going to design JavaScript code to check the validity of each input field in the following form. Note that:

  1. Be sure to trim all leading and trailing white spaces (both English and big-5) at onBlur events.
  2. You can use string manipulation functions in JavaScript to accomplish the task. You can also use regular expressions if you prefer to do so. Regular expressions are highly recommended since they will save you a lot of troubles.
  3. You can safely assume that the clients are using IE5.
範例表單如下:

加分項目:


[以下是給乙組同學的作業]

  1. 請根據身份證號碼的規則,利用亂數,一次產生五組有效的身份證號碼,範例表單如下:
    請輸入第一個英文字母:
    請注意:
    1. 輸入的英文字母必須是合格的。
    2. 必須將英文字母轉成大寫,再加上九位數字。
    3. 必須利用亂數產生,所以每次產生的五組號碼都應該不一樣。