var ExtensionList = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];
jQuery("#file").change(function () {
if (jQuery.inArray(jQuery(this).val().split('.').pop().toLowerCase(), ExtensionList ) == -1) {
alert("Only \'jpeg\', \'jpg\', \'png\', \'gif\', \'bmp\' are allowed.");
jQuery(this).val('');
}
});
jQuery("#file").change(function () {
if (jQuery.inArray(jQuery(this).val().split('.').pop().toLowerCase(), ExtensionList ) == -1) {
alert("Only \'jpeg\', \'jpg\', \'png\', \'gif\', \'bmp\' are allowed.");
jQuery(this).val('');
}
});
No comments:
Post a Comment