Use JavaScript verification form commit
The first thing we have to verify in that Form, what we have to do is:
Analysis here,
1. Name = "f" Generally we verified that you don't need to name the form, but here, why, what you need to verify the TEXTFIELD of that form?
2. Language = "javascript" Here you need to point out what the verified scripting language is not case sensitive.
3. οnsubmit = "Return f_submit ()" Here, the value of return is very important, it will be used in the JavaScript scripting language, can not be in line with the script! The front onSubmit must write all, write into submit, write Can not!
Then we see JavaScript
Function f_submit () {
IF (Document.f.title.Value == "")
{
Alert ("Sorry, no input")
Document.f.title.focus ()
Return False
}
Else if (Document.frmaddLink.Content.Value == "")
Document.frmaddlink.content.focus ()
script>
1. Note Function F_Submit () Strictly Case Size! Function Write into Function is not possible, as for f_submit (), is the value of Return's Return to be inSubmit in Form, of course, the appearance can, of course distinguish!
2. The following f.TITLE represents the value of the form, you want to match TextField!
3. Java / C language plus sequencing after each sentence, but JavaScript can't add! It is very uncomfortable here, I always like to add the semicolon. Other statements can understand.
The above is simply analyzed from the Form verification application, JavaScript is completely different from Java, perhaps it is also very valuable. After all, Google is still trying to do! If you have time, you should study hard.
CSS learning in
9pt
(Background-color: # 0099cc; color: fffff;}