Quote:
Originally Posted by Philip M
The accept attribute is not supported in Internet Explorer and Safari. That makes it pretty useless.
|
http://wufoo.com/html5/attributes/07-accept.html
seems like both support it. it's a cheap addition that works for most users and even without javascript.
certainly simpler than jQuery.
covering
all the bases:
Code:
<input type=file
accept="image/*"
pattern="/\.(gif|jpe?g|png)$/i"
onchange='if(
( this.files &&
this.files[0] &&
!this.files[0].type.match("image/*") ) ||
!this.value.match(/\.(gif|jpe?g|png)$/i) ){
this.value=''; } '
/>