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: , , ,
Posted in javascript, Programming

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>