key Functions
When validating the legality of user registration information through JavaScript, it is often necessary to test the numerical data.
JavaScript can use the isNaN () function to implement the above functions, which are explained below.
IsNaN () function
Used to determine whether the parameter of the function is numeric, returns false, or true.
Grammar
BOOL IsNaN (VAR)
The parameter var is the data to be judged.
function implementation
When the user fills out the registration information, the information should be verified in order to ensure the legality of the information. Verification of the legality of registration information can be implemented either by applying PHP code or by applying JavaScript. Developers can choose according to the actual situation, if you are concerned that the client browser restrictions on JavaScript, it can be implemented in PHP code, but using this method to verify the registration information is done on the server, so a lot of wasted server resources. The application of JavaScript script to verify the user's registration information is implemented by the client browser, so it will save the server resources to a great extent. The verification of user registration information is implemented by JavaScript. When writing the user registration information validation module, the code that implements the user registration information validation is encapsulated in the Custom function Chkinput login () and called in the OnSubmit event of the form tag, chkinput the code for the login () function is as follows.
Below are
The following is include_once ("top.php"); ?>
Include_once ("left.php"); ?>
|
|
|
|
|