Use the combination of the specific and functional methods, but also check the next Article JavaScript sample code for form validation using regular expressions
Copy Code code as follows:
Matching regular expressions for Chinese characters: [U4E00-U9FA5]
Commentary: Matching Chinese is really a headache, with this expression will be easy to do
Match Double-byte characters (including Chinese c
JavaScript Regular verifies that the string is empty
Purpose: Check if the input string is empty or all are spaces
The input quantity is a string: str
Return: Returns True if the input amount is NULL or FALSE
function IsNull (str) {
if (str = "") return true;
var Regu = "^[]+$";
var re = new RegExp (regu);
return Re.test (str);
Regular expression Validation mailbox
Although Prototype.js is also used to write, the implementation of the class is still using the method in JavaScript advanced programming because of its lack of understanding. When using AJAX for data validation, XML was used initially as a data source, but after a period of time, XML was found to be inefficient, and JSON was used as the data source.
A year has passed, the customer has put forward new requ
JavaScript form authentication Age
JavaScript form validation age, to determine whether an input is in line with age, implemented through regular expressions.
Check Age
function Isage (str) {
var mydate=new Date;
var now=mydate.getfullyear ();
if (str return false;
}
return true;
}
Regular expression Validation mailb
javascript| Form Validation | dynamic
Online down an ASP dynamic generated form to verify JavaScript code, the expansion of their own. I have forgotten the name of the author, but I remember clearly that the code from the first to the Nineth is the author's original one. As for the nine to the 15th is my own add oh. And because of my limited level, from Nineth to
Enable the unobtrusive JavaScript feature in ASP. The client-side validation JS code (combined with jquery.validate) can be automatically generated at run time by the server end based on the validation rules set in model. This solves the problem of the form validation one time code, two authentication (client + server
Enter the email address in JavaScript to automatically prompt the instance code.
This article describes how to automatically prompt the instance code by entering the email address in JavaScript. For more information, see
I wanted to share my previous comments on artTemplate source code parsing. However, after a year,
}$ the correct format is: Start with a letter, length between 6-18, can only contain characters, numbers and underscores.
Verify that it contains ^% ',; =?$\ ' and other characters:[^% ', =?$\x22]+
Verify Chinese characters: ^[\u4e00-\u9fa5],{0,}$
Verify email Address: ^\w+[-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$
Verify interneturl:^http://([\w-]+\.) +[\w-]+ (/[\w-./?%=]*) $ ^[a-za-z]+://(w+ (-w+) *) (. w+ (-w+) *) *) * (? s*)? $
Verify p
After the user fills out the form submits, the server-side script verifies the data first, guarantees the data correctness (for example, the data conforms to the request content, the format is correct, etc.) and then the data to the database storage for later use. You can also use JavaScript on the client computer to verify forms, faster, more efficient user operations. While there are many advantages to using Jav
The most common verification is email address verification. Websites are common. Various web scripts also use regular expressions "(Regular Expression) Verify the email address we entered to determine whether the email address is valid. Some can also separate the username and domain name. Use nowJavascriptThe language implements
javascript| data
Practical JavaScript transfer value, data validation, event triggering summary
1. And JSP transfer value problem:
1 Data validation Transfer value of normal submission form
HTML page Input:
Javascript gets the value and processes it:
This is equivalent
Email
Email address format
Url
URL format based on HTTP protocol
Phone
Phone number format
Mobile
Mobile phone number format
Currency
Currency format
Zip
Zip code
Idcard
javascript| function
First, the Verification class1, digital verification within1.1 Integers1.2 Integers greater than 0 (validation of ID to be transmitted)1.3 Validation of negative integers1.4 integers cannot be larger than IMAX1.5 integers cannot be less than imin2, Time Class2.1 Short time, form (13:04:06)2.2 Short
Native JavaScript phone number verification, email verification, id verification. When used, pass in the string to be validated, return ture to represent conformance, return false code does not conform.Use:
document.getElementById ("Btnphone"). Onclick=function () {
alert (Validationhandler.isphone ( document.getElementById ("Phoneinput"). Value) ==true?
JavaScript Data Validation Class/*JavaScript: Authentication class Author: Yang Bo date:201603231, User name authentication 2, password Authentication 3, repeat password verification 4, mailbox verification 5, mobile phone number verification 6, Verification code verification*/varYb_validate =function(){ //User Name Verification This. Username =function(us
This cell phone number is the correct validation function can be said to be the latest support, which has a detailed description, no matter what the next increase in the number of sections we are very easy to modify a little bit.
JavaScript phone number Regular expression validation function
Copy Code code as follows:
IP and domain name
, -}$ the correct format is: Start with a letter, length in 6-18, only characters, numbers, and underscores can be included. Verify that you contain^%',; =?$\ "and other characters:[^%',; =?$\x22]+Verify Kanji:^[\u4e00-\u9fa5],{0,}$ Verify email address:^\w+[-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$ verify InternetURL:^http://([\w-]+\.) +[\w-]+ (/[\w-./?%=]*)? $; ^[a-za-z]+://(w+ (-w+) *) (. ( w+ (-w+) *) * (? s*)? $ verify Phone Number:^ (\ (\d
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.