JQuery Ajax displays the check mark and error number to verify that the entered verification code is correct. jqueryajax
If you don't talk much about it, paste the Code directly. The specific code is as follows:
First introduce jquery
.sl-error-verifycode { background-image: url("images/icons.png"); background-position: -26px 0; background-repeat: no-repeat; display: block; font-size: 18px; height: 23px; l
Vb. NET code verifies that the credit card number is correct, this code uses the Luhn algorithm to verify
Dim Creditcardnumber as String
creditcardnumber = "1234567891234563" Please enter the number you want to verify by yourself
If Creditcardnumber.length
for x = 0
to num = creditcardnumber.substring (x,
Use a regular expression to verify the email address and mobile phone number
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform to a certain syntax rule.
Regular expression
Use a regular expression to verify the email address and mobile phone number.
Regular Expression, also known as Regular Expression and Regular Expression (English: Regular Expression, often abbreviated as regex, regexp or RE in code), is a concept of computer science. Regular Expressions use a single string to describe and match a series of strings that conform to a certain syntax rule.
Regular expressio
Method OneIf you determine whether the input is a number, if it is not a number popup a hint: The simple code is as follows:Method Two:method Three: Regular expressionsThe most complete and accurate method: (Regular expression)1)"^\\d+$"//nonnegative integer (positive integer + 0)"^[0-9]*[1-9][0-9]*$"//Positive integer"^ ((-\\d+) | (0+)) $ "//non-positive integer (negative integer + 0)"^-[0-9]*[1-9][0-9]*$"
Use JavaScript to verify the regular expression of the mobile phone number. The Code is as follows:
Function checkMobile () {var phone = document. getElementById ("phone"). value; var reg0 =/^ 13 \ d {5, 9} $/; // 130--139. At least 7-bit var reg1 =/^ 153 \ d {8} $/; // China Unicom 153. At least 7 bits var reg2 =/^ 159 \ d {8} $/; // move 159. At least 7-bit var reg3 =/^ 158 \ d {8} $/; var reg4 =/^ 150 \
This article describes how to use jquery to verify your email address and mobile phone number. The specific implementation ideas and Code are as follows:
The Code is as follows:
// Jquery verification emailFunction checkSubmitEmail (){If ($ ("# email"). val () = ""){// $ ("# ConfirmMsg" pai.html ("the email address cannot be blank! ");Alert ("email cannot be blank! ")$ ("# Email"). focus ();Return fal
C # verify the ID card number,
18-digit number:
1 private static bool CheckIDCard18 (string Id) 2 {3 long n = 0; 4 if (long. tryParse (Id. remove (17), out n) = false | n
15-digit number:
Private static bool CheckIDCard15 (string Id) {long n = 0; if (long. tryParse (Id, out n) = false | n
email address/// /// Whether the email address is used/// /// Public static bool isemail (string inputdata){Match m = regemail. Match (inputdata );Return M. success;}
# Endregion
# Region phone, zip code, network address, mobile phone number, price/// /// Verify the phone number/// Public static bool isphone (string inputdate){If (! String. isnullorempty (inputd
/*Purpose: Verify the format of IP addressInput: Strip:ip AddressReturns: False if return true through validation;*/Java code
1. function f_check_ip (obj)2. {3. Var re=/^ (d+). (d+). (d+). (d+) $/; Regular expressions that match an IP address4. if (Re.test (Obj.value))5. {6. If (regexp.$1 7.}8. F_alert (obj, "Please enter a legitimate computer IP address");9. return false;10.}11.
function F_check_ip (obj){var re=/^ (d+). (d+). (d+). (d+) $/; R
To thank the 12306 real-name!Temporarily discovered that there are three sites that can be verified,One is http://www.nciic.com.cn/framework/gongzuo/index.jsp5 Yuan at a time, black!Second, polymerization api,http://www.juhe.cn/docs/api/id/103249 Yuan January, limit 100 times, black!Three is the 12306 of hard-won,Registration number, personal information, if the match and the person has registered 12306, then will prompt identity card has been registe
Use a regular expression to verify whether the input is a number
Sometimes the content entered in the text box must be data. How can we determine whether the content entered by the user is legal? Here I use a regular expression to achieve this effect, two lines of code (C #) done! Haha...
Static bool isnumeric (string Str)
{
System. Text. regularexpressions. RegEx reg1
= New system. Text. regularexp
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.