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      }) 

live demo

any appreciated!

since want insert error message before invalid element, use insertbefore():

errorplacement: function(error, element) {     error.insertbefore(element); } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -