Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

http://s4.postimage.org/bpmlh7b65/error.jpg

and this also not worked for me an error occurd when I tried this:

error.insertBefore(element)
error.css('float','left')

or:

error.attr('style','float:left')

only I can add these properties like this:

$(error).someproperty

This is my code as I can't copy paste because I work on TFS and copy/paste is not allowed. Problem is that with this code I can not float left error message. I want that error should appear on left and below the textbox. One thing more, I was just testing and I put float =right in picture above so forget about it. float:left is also not working. I have checked it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
149 views
Welcome To Ask or Share your Answers For Others

1 Answer

As per the documentation, rules('add', rules) is only a method for adding your rules and their messages, nothing else. You've improperly placed errorElement:, wrapper:, and errorPlacement: within your rules('add', rules) method.

errorElement:, wrapper:, and errorPlacement: are not rules. These are called options and therefore would only be placed within .validate(options).

$(document).ready(function(){
    $('#myform').validate({
        errorElement: 'div',
        wrapper: 'div',
        errorPlacement: function(error, element) {
            error.insertAfter(element); // default function
        }
    });
});

Otherwise, I don't know what you're asking and you should put your actual code within the OP, so we don't have to re-type it in order to answer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...