开发者

Jquery Validation Div containing all messages plus text/image next to errored input

How do i (using jquery validation) put all the messages in a div tag but leave the errors next to the input field?

At the moment i seem to be only able to have one or the other.

For the Div tag errors i have used errorLabelContainer: but if also try to use errorPlacement: to put a message/image next to the input box it does nothing.

Is it possible to use errorPlacement to put the error in more than one place?

for an example look at https://www.which.co.uk/login just submit the form. You get the errors at the top of the开发者_C百科 page as well as errors next to the required field. As far as i can see from there code, they have re-written the validator.

Regards, Pete


Try How to display jQuery Validation error container only on submit

It worked for me.

My code:

errorElement: "div",
errorContainer: container,
errorClass: "errorInValid",
errorPlacement: function (error, element) {
    var errorClone = error.clone();
    $("#ErrorStrip").append(errorClone);
    error.insertAfter(element).bind("hide", function () {
        errorClone.hide();
    });
},
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜