I want validate file name format to prevent files names like "this.is.an.image.png".
I have jquery validation on my page and the next jquery validate script:
<script>
$.validator.addMethod("checkFileName", function(value, element) {
return this.optional(element) || /\\([a-z0-9])*\.(jpg|png|jpeg)/i.test(value);
}, "El nombre de la imagen no puede tener puntos.");
var $validator = $("#editarCabecera").validate({
errorClass: "is-invalid",
errorElement: "errorLabel",
validClass: "is-valid",
rules: {
textoGrande: {
required: true
},
imagen: {
required: true,
checkFileName: true
}
},
messages: {
textoGrande: {
required: ""
},
imagen: {
required: ""
}
}
});
</script>
Hi!
I want validate file name format to prevent files names like "this.is.an.image.png". I have jquery validation on my page and the next jquery validate script:
How I can apply this check to dropify ?