1

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

djot
  • 2,952
  • 4
  • 19
  • 28
Sameer Z.
  • 3,265
  • 9
  • 48
  • 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
  • 21,211
  • 8
  • 65
  • 72