Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Validate dropify with jquery #115

Open
OriginersMc opened this issue Apr 22, 2020 · 0 comments
Open

Validate dropify with jquery #115

OriginersMc opened this issue Apr 22, 2020 · 0 comments

Comments

@OriginersMc
Copy link

OriginersMc commented Apr 22, 2020

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:

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

How I can apply this check to dropify ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant