JQuery Image File Validation


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**** VALIDATE IMAGE ***/
  2. function validateImageFile(fld_value) {
  3. if(!/(\.bmp|\.gif|\.jpg|\.jpeg)$/i.test(fld_value)) {
  4. //alert("Invalid image file type.");
  5. //fld.form.reset();
  6. //fld.focus();
  7. return false;
  8. }
  9. return true;
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.