したがって、現時点では次のコードがあります。
$(window).load(function () {
$('#browse-click').bind('click', function () { // use .live() for older versions of jQuery
$('#file-type').click();
return false;
});
});
非表示の複数ファイル入力があり、上記のコードを使用するボタンがそれにバインドされています。
ポップアップダイアログで「開く」ボタンをクリックした後に選択されたファイルの数を取得するにはどうすればよいですか?
HTML コード:
<!-- Hide this from the users view with css display:none; -->
<input style="display: none;" id="file-type" type="file" size="4" name="attachment[]" multiple />
<!-- Style this button with type image or css whatever you wish -->
<input id="browse-click" type="button" class="button" value="Select Files"/>