jquery Formvalidator Mailbox Address Verification

Source: Internet
Author: User
Tags constructor datetime numeric

jquery Formvalidator Mailbox Address Verification

var regstring= ' ^[1-9]d*$ ';//string says
var reg=new regexp (regstring);//string to RegExp
The direct writing of Var reg=/^[1-9]d*$/;//

Email address

w+ ([-+. '] w+) *@w+ ([-.] w+) *.w+ ([-.] w+) *

How could formvalidator such a low-level bug. Enter an email address yourself without adding. com incredibly prompt correctly. Suddenly brother has no language. Finally, it was modified to a regular expression in vs2010.

The types of controls supported for each format are as follows:

Input TextArea Select
Check mode Text Radio CheckBox File Password TextArea Select-one
Inputvalidator
CompareValidator
Ajaxvalidator
Regexvalidator
Functionvalidator
If you use an unsupported checksum, the plugin will ignore this checksum function.

plugin currently prompts for errors, there are two modes: Showword and Showalert, that is, Text hints and window prompts , the following 4 major authentication methods, for the Showalert this way is not necessary, Some configurations are not useful.
listed below are the properties that are exposed by global initialization and 5 checksum methods, respectively.
Formvalidator: The type used for initialization must be performed first. ("√" for Showalert available parameters)
Property Property name Default value Showalert Explain in detail
Validatorgroup Validation group "1" The control of a page can be divided into groups, and a separate checksum
Empty Can be an empty False
Automodify Automatically fix errors when you enter errors to leave the focus False First give the prompt then, automatically fix, currently only supports text, file, textarea three kinds
Onempty Tips for empty time "Blank Entry" can be null, the prompt for the empty time. is not displayed for the empty person
OnShow Tips for displaying time "Please enter the content" is not displayed for the empty person
onfocus Tips for getting focus "Please enter the content" is not displayed for the empty person
Oncorrect Enter the prompt after the correct "Input correct" When you focus away from the control, the prompt will appear if the input is correct. is not displayed for the empty person
Tipid Display the container ID for the error Form id+ "Tip" If the hint layer is not built automatically, indicate the ID number that is prompted
If the hint layer is automatically built, it represents the target control relative to the hint layer
TIPCSS Tutorial Styles for automatically constructed hint layers "Left": "10px",
"Top": "1px",
"Height": "20px",
"width": "250px"
A hint layer used primarily for locating automatic builds
Forcevalid Force entered value must be valid True Whether to treat a full-width character as a parameter of 2 lengths
DefaultValue Default value Null All input and select forms. If you do not set it, keep the original value, once the setting is set to the default value.
Triggerevent Default value Blur Currently supports 2 property values:
Blur: Trigger when losing focus
Change: Triggers when the value in the input box changes
Inputvalidator:
Property Property name Default value Explain in detail
Type Comparison type "Size" (Invalid for Select)
' Size ': Indicates comparison length, default value
"Number": Comparison of numeric values
' String ': Character comparison
' Date ': Short Date type
"datetime": Long Date type
Min Minimum Length/value 0 The default numeric type. If you are comparing characters, please pay the character type
For Select-one, the parameters in Inputvalidator min and Max indicate the range of index numbers selected
For Select-multiple, the parameters in Inputvalidator min and Max indicate the number of selections
Max Maximum length/value 99999999999 Ditto
OnError Tips for errors "Input Error" is not displayed for the empty person.
Onerrormin Smaller than the MIN attribute hint Null Error prompts when the user enters a value that is smaller than the min attribute
Onerrormax Hints larger than the Max attribute Null Error prompts when the user enters a value that is larger than the Max attribute
Empty Whether control text values allow both sides to be empty Null is allowed on both sides Default value {Leftempty:true,rightempty:true,emptyerror:null}
Leftempty: Indicates whether NULL is allowed on the left
Rightempty: Indicates whether the right side is allowed to be empty
Emptyerror: The prompt at which the error occurs, and if NULL, the OnError property is used to prompt for an error.
CompareValidator:
Property Property name Default value Explain in detail
Desid To compare the ID of a control "" Target ID to compare to the source target
Operateor Comparison symbol "=" There are several types: =,!=, >, >=, <, <=
DataType Data type "String" Only 2 types are currently supported: "string", "Number", "datetime", "date"
OnError Tips for errors "Input Error" is not displayed for the empty person.
Regexvalidator:
The
properties property name defaults detailed explanation
regexp Regular expression " uses the explicit constructor new RegExp ("pattern" [, "Flags"]), and because the Web effect "is used as an escape character, it is necessary to use the" instead of " when using the display constructor to construct an instance object.
param "I" g: Delegates can make global matches.
I: Represents a case-insensitive match.
M: Represents the multiple-line matching that can be made. The
can be any combination, and of course you can not add parameters
datatype data type "string" "string": write-Yourself expression, "enum": Pieces Give me a name. See demo3.htm
You can modify it yourself, add an enumerated item name and an expression in formvalidatorregex.js.
onerror: Prompt for error "input error" is not displayed.
Ajaxvalidator: Almost all properties are the same as $.ajax (), please refer to the help of the $.ajax () function
Property Property name Default value Explain in detail
Type Type of request "Get" "POST" or "get"
Url Address of the URL sent to ""
DataType The data type returned "HTML" XML, HTML, script, JSON
Data Data ""
Async Whether to send in an asynchronous manner True
Success The function that is called when the request succeeds Null
ProcessData Automatically processes the returned data as a string True By default, if the data option is passed into an object instead of a string, it will automatically be processed and converted into a query string
Complete The function that is called when the request completes Null
Beforesend Functions called before the request Null There is one parameter, the same as the Beforesend parameter in the root $.ajax.
Buttons You dot submit the button (group) jquery Object Null When you trigger the AJAX checksum, the corresponding button (group) in the buttons is grayed out until the server returns the data.
Error The function that is called when the request fails "Request Failed" You can define the error yourself and automatically play it in the error. is not displayed for the empty person.
Functionvalidator
onerror /tr>
properties property name default explanation of return value
fun external function name ()
Parameter 1: value of element,
Parameter 2: Element object
default as Process
Verify success/failure
string checksum failed with return value as custom error
No processing procedure
prompt for error "Enter error" function return False
Common functions: The main is to set global parameters and determine whether through the checksum
The name of the function Function description
$.formvalidator.initconfig Parameters: Configuration Type
Property Default value Description
Validatorgroup "1" Which group do you want to configure for
Formid "" The form ID number to register the Pageisvalid function automatically
Alertmessage False Whether to pop up a window
Autotip False Whether to automatically build a hint layer
Errorfocus True Whether the first error control receives the focus when an error occurs
Forcevalid True Do you want to leave the focus until you have entered correctly?
Wideword True Do you want to treat a full-width character as 2 lengths
Onsuccess Null This group validates the callback function after passing, returns false, prevents the form from submitting
Submitonce False Do you want to erase all the submit buttons after passing the check?
OnError Null The callback function after the failed checksum for this group has two parameters
Parameter 1 An error message that the checksum does not pass
Parameter 2 An element object that does not pass validation
Debug False is in debug mode. True: Do not submit the form
$.formvalidator.pageisvalid One parameter: not a configuration type
Validatorgroup "1" Which group do you want to validate against?
$.formvalidator.isonevalid One parameter: The table cell element ID that was set to validate.
Returns the information that verifies the success.
$.formvalidator.setfailstate function ("Tipid", "displayed information")
In Showword mode, if your extra checksum does not pass, you can set it to fail information and status
$.formvalidator.getlength function ("table cell element ID")
The number of selections that a CheckBox or RadioButton represents (the same group).
For Select-one, select the value of the index
The number of selections in the Parameters min and Max in Select-multiple,inputvalidator
Other input represents the length of the character.
$.formvalidator.retsettips Tutorial Tate function (validation group number) to restore the contents of the group's prompts to the OnShow state

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.