0

I have a button which acts as an upload file button, which works fine on all browsers except Safari, you can see here:

http://machinas.com/

if you click on "Contact Us" and the Attach file in the form, it doesn't work.

HTML

<label for="file" style="display:none">Attach file:</label>
    <input type="file" id="file" name="file" accept="image/jpg, image/jpeg, image/gif, image/png, application/pdf, .txt, application/pdf, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.slideshow, application/vnd.openxmlformats-officedocument.presentationml.presentation" class="multi" maxlength="1" />
   <button id="fileSelect">attach file (max. 2MB)</button>

JQUERY

document.querySelector('#fileSelect').addEventListener('click', function(e) {
  // Use the native click() of the file input.
  document.querySelector('#file').click();
}, false);
user1937021
  • 10,151
  • 22
  • 81
  • 143

0 Answers0