'Accept' attribute of input element is not working

24,027

according to the w3schools (http://www.w3schools.com/TAGS/att_input_accept.asp), the 'accept' attribute is not properly supported by any of the major browsers. The filter inside the file browser dialog will not work.

You could use a javascript validation on the form onsubmit event to verify if the file type is correct, returning false otherwise.

Share:
24,027
Md. Shadikul Islam
Author by

Md. Shadikul Islam

Updated on October 31, 2020

Comments

  • Md. Shadikul Islam
    Md. Shadikul Islam over 3 years

    I came across a browse file dialog-control tag in html and the tag was

    <input id="myfile" name="myfile" type="file" accept="application/pdf"/>
    

    but the 'accept' attribute doesn't seems to have any effect. I am using Internet Explorer 8.