【发布时间】:2011-07-09 16:09:53
【问题描述】:
我正在使用这个版本的jQuery表单插件https://raw.github.com/malsup/form/master/jquery.form.js 提交时出错:
form.submit();在线错误
SCRIPT87: Invalid argument. jquery.form.js, line 347 character 5
我的代码:
<form id="ajaxUploadForm" action="@Url.Action("Upload", "Home")%>" method="post" enctype="multipart/form-data" >
<fieldset>
<legend>Upload a file</legend>
<label>File to Upload: <input type="file" name="file" /></label>
<input id="ajaxUploadButton" type="submit" value="Upload" />
</fieldset>
</form>
$(function () {
$("#ajaxUploadForm").ajaxForm({
iframe: true,
dataType: "json",
beforeSubmit: function () {
// $("#ajaxUploadForm").block({ message: '<img src="/Content/themes/start/images/progress.gif" />' });
},
success: function (result) {
// $("#ajaxUploadForm").unblock();
//$("#ajaxUploadForm").resetForm();
$.growlUI(null, result.message);
},
error: function (xhr, textStatus, errorThrown) {
//$("#ajaxUploadForm").unblock();
//$("#ajaxUploadForm").resetForm();
$.growlUI(null, 'Error uploading file');
}
});
});
我正在侧面的简单模型对话框中进行此上传。
可能有人知道如何解决这个问题?
【问题讨论】:
标签: asp.net-mvc-3 jquery-plugins