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

Validate dropify with jquery #115

Description

@OriginersMc

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions