1

Is it possible to validate the image dimension on client side using jquery or any other framework?

djot
  • 2,927
  • 3
  • 17
  • 28
Sameer Z.
  • 3,237
  • 8
  • 45
  • 72

1 Answers1

-1
$.validator.addMethod("imageonly", function(value,element){     
        var pathLength = value.length;
        var lastDot = value.lastIndexOf(".");
        var fileType = value.substring(lastDot,pathLength).toLowerCase();
        return this.optional(element) ||  fileType.match(/(?:.gif|.jpg|.png|.bmp)$/);
    }, "Please upload image file only");
Scott
  • 20,335
  • 7
  • 59
  • 71