适用于除 IE8 之外的任何地方。提交永远不会触发。我尝试取出对话框并离开提交,但在 IE8 中仍然没有任何反应。
Javascript:
$(function () {
$("#fileUpload").click(function () {
$("#fileButton").click();
});
});
$(function () {
$("#fileButton").change(function () {
$("#dialogUploading").dialog({
dialogClass: 'no-close',
modal:true,
async:true
});
$("#formSubmit").submit();
});
});
HTML:
using (Html.BeginForm("ReferralUpload", "ReferralNetwork", FormMethod.Post, new { enctype = "multipart/form-data", id = "formSubmit", style = "display:inline" }))
{
<input type="file" id="fileButton" name="fileButton" style="display:none" />
<button type="button" id="fileUpload" style="width:250px;">Upload Referrals</button>
}
有任何想法吗?谢谢!