Currently, almost all my Js verification forms use the onsubmit = "Return checkforms (this)" method for verification. The checkforms method is defined as follows:
Function checkform (myform)
{
}
At this time, you can verify the Add Record Form or the form of the modification record. The problem arises. If it is a modification, there will certainly be some items that are not included during the addition, for example: when you add a user, the original password is less than when you modify the user. Therefore, the original password old_pw control exists in Javascript. This requires if (typeof myform. old_pw! = "Undefined") to determine,
In addition, there is a strange problem: when you use document. getelementbyid ("old_pw") to determine whether the control exists, you need to use
If (document. getelementbyid ("old_pw ")! = NULL) to determine, document. getelementbyid ("old_pw") returns the object through the test ff, ie