Jquery validate poshytip custom Style

Source: Internet
Author: User

Recently, a jquery. validate bubble prompt is provided in the project.
It seems that this function is available in jquery. validate of the latest version, but it is not easy to use here.
Add one on your own.
I found some plug-ins with good qtip2 styles, but I cannot display them locally. He also has examples of jquery. validate. However, the style is not displayed here. It seems that the jquery version can be used for display. You can't use mine. Give up.
Poshytip-1.1 this, style is good!
PositionX and positionY are the locations where the prompt is displayed. Copy codeThe Code is as follows: $ (document). ready (function (){
// Validate the comment form when it is submitted
Var myForm = $ ('form: first ');
MyForm. validate ({
Onkeyup: false,
Success: function (element ){
Var elem = $ (element );
Elem. poshytip ('disable ');
Elem. poshytip ('deststroy ');
},
ErrorPlacement: function (error, element ){
Var elem = $ (element );
If (! Error. is (': empty ')){
// Right: x = right; y = center
// Left: x = left; y = center
// Top: x = inner-left
// Bottom: x = center; y = bottom
Var aX = "center ";
If (elem. attr ("positionX ")! = Null ){
AX = elem. attr ("positionX ");
}
Var aY = "bottom ";
If (elem. attr ("positionY ")! = Null ){
AY = elem. attr ("positionY ");
}
Elem. filter (': not (. valid)'). poshytip ({
Content: error,
AlignTo: 'target ',
AlignX: aX,
AlignY: aY,
OffsetX: 0,
OffsetY: 5
});
} Else {
Elem. poshytip ('disable ');
Elem. poshytip ('deststroy ');
}
}
});
});

Problems
Onkeyup cannot be thought of as true, because in this way, some validation, bubbles will always exist. This is unscientific. Do you have any good solutions?

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.