jQuery Validation - error placement -
i'm trying use 'errorplacement' jquery validation docs:
$("#myform").validate({ errorplacement: function(error, element) { error.appendto( element.parent("td").next("td") ); }, debug:true })
i want place error before not valid input, not work:
$("#myform").validate({ errorplacement: function(error, element) { error.appendto( element.parent("form").prev("input") ); }, debug:true })
any appreciated!
since want insert error message before invalid element, use insertbefore():
errorplacement: function(error, element) { error.insertbefore(element); }
Comments
Post a Comment