开发者

Error Placement of a Form

I'm trying to use the following plugin wiht the second form where it places all the error messages inside of its separate div. Only difference is they place it above it and I'm placing mind below. However its still not displaying开发者_Go百科 the messages inside the div for me. Not sure why.

http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

Demo: http://jsfiddle.net/xtremer360/KHSKm/1/

Edit: I updated my code want to show what I have now to how it's not placing the error messages inside of the div I have made for errors when there are errors for the form submission.

Updated Demo: http://jsfiddle.net/MtRn6/


You need to use errorPlacement to put the error messages where you want them, otherwise it will use the default method of appending them to the input:

// container is the element which should hold errors,
// You have already definied it in your demo
errorPlacement: function(error, element) {
        error.appendTo(container);
},

Updated demo: http://jsfiddle.net/MtRn6/1/

Check the docs for more info: http://docs.jquery.com/Plugins/Validation/validate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜