Read about simple email validation in javascript, The latest news, videos, and discussion topics about simple email validation in javascript from alibabacloud.com
Try testing the following form with valid and invalid email addresses. The
Code uses JavaScript to match the users input with a regular expression.
Function code:
Copy Code code as follows:
function Validate (Form_id,email) {
var reg =/^ ([a-za-z0-9_\-\.]) +\@ ([a-za-z0-9_\-\.]) +\. ([a-za-z]{2,4}) $/;
var address = Document.forms[form_id].ele
Try testing the following form with valid and invalid email addresses.
Code uses javascript to match the users input with a regular expression.
Function Code:
Copy codeThe Code is as follows: function validate (form_id, email ){
Var reg =/^ ([A-Za-z0-9 _ \-\.]) + \ @ ([A-Za-z0-9 _ \-\.]) + \. ([A-Za-z] {2, 4}) $ /;
Var address = document. forms [form_id]. element
JavaScript validates content as a number and a simple instance with a length of 10
Above this JavaScript validation content is a number and a simple example of length 10 is a small series to share all the content of everyone, hope to give you a reference,
asp.net| Example | download
(a). Overview and FunctionsTwo methods are used to validate the email format, asp.net the validation controls, and manually write code validation. and use it to simple factory and fitting design patterns, code refactoring technology. Implement custom ema
means that users do not have to enter the same information two times when the form is invalid!The script comes with a series of predefined rules, but you want to verify that each input in the form depends on you. Using custom functions, you can connect scripts and provide your own validation rules and error messages.Online preview14.JavaScript Form Validation Li
JavaScript can be used to validate these input data in an HTML form before the data is sent to the server.
The typical form data that is validated by JavaScript is:
• Has the user filled out the required items in the form?• Is the email address that the user entered legal?• Has the user entered a valid date?• Does the user enter text in the Data field (numeric
Our search examples are still fairly simple, especially in terms of data validation; We only verify that the search key value is empty. Many HTML forms then contain more complex validations than if the detection value is empty. We have seen error messages similar to the following on our website:
Please enter a valid email address, Foo ' is not a valid e-ma
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
This article mainly introduces how to automatically prompt the instance code by entering the email address in JavaScript. If you need it, you can refer to the comments you want to share with you about source code parsing of artTemplate. However, after one year, I couldn't find the template engine, so I had to try it myself after analyzing the template engine principles.
The template engine I wrote was shar
Detailed description of JavaScript ID card number validation and instance code, and detailed description of javascript
Recently, you need to verify the validity of your ID card. real-name verification is not expected. However, the original verification rules are too simple, but they simply verify the length of your ID
A simple instance of form validation occurs when the text box loses focus:A lot of forms validation has such a function, that is, when the mouse focus away from the text box, the legitimacy of validation immediately, the following is a simple example of how to implement this
The function of form verification is very common in the production of Web site.
Sometimes, with some molding JS control will be more convenient, but too large and difficult to maintain (my JS level is not high)
So I simply wrote one myself. As for good, flexible and not flexible, but also please advise (first picture, very difficult to see, please do not mind):
Code:
Copy Code code as follows:
Form Validation JS Code
var FV ={Lang:
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
This is the website of this plugin and I found a Chinese blog. (Although the plugin's name is Jquery.validte.js, the plugin's name is called jquery validation).Basic usage can go to see Leng article or the above blog, I do not introduce in detail here.First and foremost, all the fields to be validated are in the form, and the fields must have the name attribute.For more information, please see the original link: http://www.gbtags.com/gb/share/5765.htm
1. Lightweight JavaScript Form validationReferencing files in your app validator.min.jsInstance: for= "Email" > Email verification DescriptionNew Validator (formName, option, callback)FormNameformNameis the value in the id tag name , as in the aboveexample_formOption
namenamethe corresponding value in input
display--
jquery simple Form Validation effect:As long as there is a form of the place, basic will have form validation, the following is a combination of examples of the simplest form validation, how to prevent the filling of the form content is empty.The code example is as follows:DOCTYPE HTML>HTML>Head>MetaCharSet= "Utf-8">Me
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.