folks. I need some help. I'm trying to put the validation error message right next to my input file tag, but it gives me error in console. It's showing me a message, "TypeError: error.appendTo is not a function". This is a little piece of my code
$("#foto").rules("add", {
required: true,
extension: "jpeg|jpg|png",
messages: {
required: "Tolong Diisi",
extension: "Harap Memilih Format yang Benar"
},
errorPlacement: function(error, element)
{
error.appendTo($('#foto'));
}
});
By the way, i'm using 'id' instead of 'name' which I've instantiated with
$("#formTambah").validate();