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>

Filed Under: javascriptProgramming

Tags:

About the Author: me : yeay its me arun

RSSComments (0)

Trackback URL

Leave a Reply

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin