vendredi 19 juin 2015

How to click or trigger a hidden input file on Iphone (Embjer.js development)

If I press a button, a hidden input file can be triggered:

HTML:

<button {{action 'addImage'}}>Click Me!</button>
<input id="addAttach" type="file" accept="application/*, image/*" style="display:none" />

JS (Ember.js):

actions:{
        addImage: function(){                                       
            Em.$('#addAttach').val('').click();
        }
}

But it doesn't work in Chrome on an iPhone.




Aucun commentaire:

Enregistrer un commentaire