fileをアップロードしたくinput type="file"をchangeイベントで監視しているのですがうまく行きません。
input type="file"を画像にしたくstyle="display:none;を設定しtype="button"の方でonClick="$('#file').click();という風にボタンが押されたらinput type="file"が動くという風にしているのですがそれが原因なのでしょうか?
html
1<form action="/upload" method="post" enctype="multipart/form-data" id="form" name ="form"> 2 <input type="file" id="file" name="filepath" style="display:none;"> 3 <button id="btnUpload" class="btn-converter non-draggable" type="button" name ="filepath" onClick="$('#file').click();"></button> 4</form>
jquery
1function uploadfile(){ 2 $('#file').change(function() { 3 console.log("aaa"); 4 }); 5}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。