How to validate image File field using Javascript

<script type=”text/javascript”>
function validateFileExtension(ld) {
if(!/(\.bmp|\.gif|\.jpg|\.jpeg)$/i.test(ld.value)) {
alert(“Invalid image file type.”);
ld.form.reset();
ld.focus();
return false;
}
return true;
}
</script>

About

me : yeay its me arun

Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.