Create / add a new method:
jQuery.validator.addMethod("imgType", function(value, element) {
var extension = value.substr( (value.lastIndexOf('.') +1) );
if(extension=='jpg' || extension=='gif' || extension=='png'){
return true;
}else{
return false;
}
}, "=$this->lang->line('error_img')?>");
rules:{
inputImg: {required:true,imgType:true}
}
No hay comentarios:
Publicar un comentario