如何在选择文件时触发点击?
E.G(到目前为止我得到的):
<form name="form" action="" method="POST" enctype="multipart/form-data">
<input type="file" name="ImageBrowse" size="50" id="ImageBrowse"/> //selected file trigger click on button
<input type="submit" id="buttonUpload" onclick="return ajaxFileUpload();" style="display:none;"></button>
</form>
功能:
$("input").on('keyup', function(){ // what to change here to know if the file selected and the file window browser closed ?
//do somthing
});
在我的函数中要更改文件浏览器窗口是否已关闭并选择文件?
编辑1:
这是我到目前为止尝试但是没有工作:
$("#ImageBrowse,#filename").on('change', function(){
$("#buttonUpload").trigger('click');
});
答案 0 :(得分:0)
$("input").on('change', function(){
//do somthing
});