/ Published in: PHP
URL: http://stackoverflow.com/questions/8021880/javascript-validate-filename-before-upload
javascript image uplaod
Expand |
Embed | Plain Text
<script language="javascript"> function Checkfiles() { var fup = document.getElementById('filename'); var fileName = fup.value; var ext = fileName.substring(fileName.lastIndexOf('.') + 1); if(ext == "gif" || ext == "GIF" || ext == "JPEG" || ext == "jpeg" || ext == "jpg" || ext == "JPG" || ext == "doc") { return true; } else { alert("Upload Gif or Jpg images only"); fup.focus(); return false; } } </script> <li class="two">
You need to login to post a comment.
