First, verify that form:
Second, we write JavaScript as follows code to embed HTML:
Function f1_submit () {
IF (Document.f1.Dep.value == "")
{
Alert ("Sorry, department name is not entered!")
Document.f1.dep.focus ()
Return False
}
IF (Document.f1.Dep.Value.Length> 12)
Alert ("Sorry, the name is too long!")
IF (Document.f1.Dep.value! = 'ab')
// NULL is empty to judge NUM digital AB letter CHS Chinese characters BIT bit
Alert ("Sorry, please enter the department name as Chinese characters!")
script>
Third, I have written a simple analysis of JavaScript, and the value of the matching JavaScript statement has no semicolon!
Today, the organizational architecture module is written, including thorough page art, and the drop-down menu is displayed. After writing, I forgot the user input verification, remember, as long as the user is entered, it is necessary to verify:
Is it empty?
2. Whether it is Chinese characters, numbers, letters
3. Do you contain a special HTML character?
Even the Mail address verification, the book number verification, the verification of the fixed format, etc. ... It seems to be used in regular expressions, this is also important, after learning.