Read about simple email validation in javascript, The latest news, videos, and discussion topics about simple email validation in javascript from alibabacloud.com
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,
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
, the last time you select the Cancel color$ ("table. Contenttr "). Click (function () {$ (this). addclass ("AVB"). Siblings (). Removeclass ("AVB");UserID = $ (this). attr ("userid");});Gets the value of RAD loaded into radio$ ("Input[name= ' statics '][value=" +data[0]. Role status + "]"). attr ("Checked", true);Determine which Rad is selected$ (". Radclass"). each (function () {if ($ (this). attr ("checked")) {radval=$ (This). Val ();}})First 7 digits of mobile phone numberif ($ (". Photo_tex
, -}$ 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
javascript| encryption
Because of the prevalence of spam, you want to encrypt the email address in the Web page, previously used such tools, but yesterday was unable to find, so the Internet to find, in the sky to find a such encryption tool, but the results should be registered, so simple function to register Ah, my God ~, so I used JS wrote a , very
Fuchangxi's Regular:Copy CodeThe code is as follows:/^ ([0-9a-za-z\-_\.] +) @ ([0-9a-z]+\. [A-z] {2,3} (\. [A-z] {2})?) $/g The start must be one or more word characters or--plus @, then one or more word characters or--. Then the point is "." and a combination of word characters and--can have one or more combinations.Copy CodeThe code is as follows:I don't quite understand the specific rules of the mailbox. It's easier to feel the regular.Check out several types of mailbox @ prefixes1, Pure Di
The examples in this article summarize the commonly used validation functions for JavaScript. Share to everyone for your reference. The specific summary is as follows:
First, String class validation
1. Length Limit
Copy Code code as follows:
2. Can only be Chinese characters
Copy Code code as follows:
3. "Can only be Engli
Recommended reading: JavaScript form verification length
JavaScript form Validation-the first recognition of regular expressions
JavaScript form Validation-uncovering the veil of the regular expression
JavaScript can be used to
the previous general verification method in three fields of year/year, respectively), only the maximum value of the date is legal check;4.2, date format verification (please note that this validation does not validate the validity of the date, and has not found a way to get the year date data from the format ^_^):Where the format only supports Y, M, D, H, M, s (other characters as non time characters)4.3. List verification:Verify that the list (check
Cases
Add the onsubmit attribute to the form or the Add OnClick property of the Submit button, the value is return check (), the check is a JavaScript function, the validation table is single, no call, even if the validation fails will be submitted. In the check function, the validation failure returns false and retur
most complete and most accurate method:
The code is as follows
Copy Code
function Isnumber (onum){if (!onum) return false;var strp=/^d+ (. d+)? $/;if (!strp.test (Onum)) return false;try{if (parsefloat (onum)!=onum) return false;}catch (ex){return false;}return true;}
This JavaScript code is very concise, you can see.
The code is as follows
Copy Code
There is a more stupid
Form validation is used to occur on the server, the client has entered all the necessary data, and then presses the Submit button. If the data of some of the clients that have been entered is either in the wrong form or simply lost, the server sends all the necessary data back to the client and requests the form to be resubmitted with the correct information. This is a lengthy process that will increase the burden on the server.
javascript| Form Validation | dynamic | function ' Please dump it for checkform_js.asp use
'*****************************************************************************
' Function name: Checkform_js (FRMNAME,ERRSTR)
' Function: Dynamically write JavaScript Form validation functions using ASP Checksubmit ()
' Use meth
JavaScript Form Validation Regular expression encyclopedia
Using regular expressions to determine whether the Arabic numerals are 0-9
Copy Code code as follows:
function Regisdigit (fdata)
{
var reg = new RegExp ("^[0-9]$");
Return (Reg.test (fdata));
}
Use this expression to get the length of the string
Copy Code code as follows:
function Regdatalength (fdata
Copy Code code as follows:
Http://
JavaScript Validation Form Encyclopedia
1. Length Limit
Copy Code code as follows:
2. Can only be Chinese characters
3. "Can only be English
Copy Code code as follows:
4. Only the numbers
Copy Code code as follows:
5. Only English characters and numbers
Copy Code code as foll
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? " Legal ":" Illegal ")
};
document.getEl
Verify IPfunction IsIP (ipstr) {var reg =/^ (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. ( \D{1,2}|1\D\D|2[0-4]\D|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) $/g;return Ipstr.match (reg);}The regular verification of this URL is comprehensive, it verifies that the situation includes IP, domain name, FTP, level two domain name, the domain name of the file, domain name plus port! User name, etc. informationfunction Isurl (str_url) {var Strregex = ' ^ ((https|http|ftp|rts
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.