jquery Plugin-form validation plugin-Tips for culture and customization tips in messages

Source: Internet
Author: User

Pick up an article

2) messages

Tip: The simplest way to modify the default hints is to introduce message_zh.js files!

This option is available if you need to prompt within the Validate () method

Type: Object

Description: Custom hint information, key:value form, key is the element to be validated, Valule can be a string or function

Use: message:{

Username: "Please enter your user name"

filed2:{

Required: ' This field must be filled in ',

Email: ' Please add a correct email format '

}

}

It's the same as filling in the rules above.

Submithandler

Type: Function (Form)

Description: By validating a function that is running after it is added by default, the function is no longer submitted unless manually committed or using return true.

Function Type: The function accepts a parameter that represents the current DOM object

Invalidhandler

Type: Function (event,validator)

Note: This function is triggered when an invalid form (that is, when validation fails) is committed.

Function arguments: The currently validated form validator Object

Errorclass (default value error)

Type: String

Description: Specifies the CSS class name of the control that the error prompt and validation does not pass

6) Validclass (default: ' Valid ')

Type: String

Description: Adds an incoming CSS class to a successful validation control

7) errorelement (default value: lable)

Type: String

Description: Tag the wrong div or span or label with a tag

8) errorplacement (default: After an invalid element),

9) Errorcontainer

Type: selector string

Description: An error message appears when the selector matches the element to display, no error when hidden

) Errorlablecontainer

Type: selector string

Description: Put the error message in a single container

One) wrapper

Type: String

Description: Use any label to wrap up the top errorelement

One) success

Type: String or function (label,element)

Description: Each field is validated by executing the function

Function parameters:

Label: The jquery object for the informational cue label.

Element: Dom element object with current validation success

If a string is followed by a CSS class on the label of the cue message

Focus on modifying cue information

Highlight (default: Add Errorclass to validation failed form control)

Type: function (Element,errorclass,validclass)

Note: The incoming function will be executed when each control validation fails, and we can pass this configuration property to verify that the write effect is not passed.

Function parameters:

Element: Dom element object that is not currently validated

Errorclass: CSS class name for error prompt label when error

The current value of the Validclass:validclass property

Unhighlight (default: Remove Errorclass of validation failed control) (same as parameter)

Focus: Verifying the form that was passed

Debug (default value False)

Type: Boolean

When set to true, the form is not actually committed, just the validation!

Use the same method and parameters as above, acting opposite

Ignore (default: ' Hidden ')

Type: Selector

Description: Ignoring certain elements does not validate

15) 16) used in testing

jquery Plugin-form validation plugin-Tips for culture and customization tips in messages

Related Article

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.