Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<input> accept Attribute in Microsoft Edge

Anyone know how to get accept working in Edge?

<input type="file" accept=".csv">

Works fine in Chrome 44, Firefox 39, IE 11, Opera 31.

Also tried

<input type="file" accept=".csv,text/csv">

like image 249
SavageCore Avatar asked Aug 07 '15 10:08

SavageCore


People also ask

How do you accept input field?

The accept attribute specifies a filter for what file types the user can pick from the file input dialog box. Note: The accept attribute can only be used with <input type="file"> . Tip: Do not use this attribute as a validation tool. File uploads should be validated on the server.

Why do you think it's best to include the accept attribute in an input type file?

The accept attribute is incredibly useful. It is a hint to browsers to only show files that are allowed for the current input .

How do you make an input only accept an image?

Using type="file" and accept="image/*" (or the format you want), allow the user to chose a file with specific format. But you have to re check it again in client side, because the user can select other type of files.


1 Answers

"accept" attributes are definitely not supported in Microsoft Edge at this point. I confirmed your behavior as "no go" in edge, but showing up in IE via the [...] thing in the upper right of Edge.

The Edge status shows it as "Under Consideration" with just 198 votes at https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/13661175-full-spec-support-for-accept-in-input-type-file .

If you're interested in implementation of the HTTP Client Hints (aka "accept") on Edge be sure and vote it up at the URL above.

like image 82
Joe Healy Avatar answered Sep 27 '22 20:09

Joe Healy