【发布时间】:2011-09-29 11:01:39
【问题描述】:
我正在使用 Zend 框架。 这是 index.phtml :
<div id="edit-add-form" title="Insert">
<form id="main-form" name="main-form" action="" method="post" enctype="multipart/form-data">
</form>
</div>
<a onclick="openAddPopup()">Open Popup</a>
我使用 ajax 从 addForm.phtml 将内容加载到模态对话框(edit-add-form div 元素):
openAddPopup = function(){
$.ajax({
type: "POST",
url: '<?php echo $this->baseUrl()?>/core/database/landmark',
data: "&act=insert",
success: function(result,status,xResponse) {
$("#main-form").html(result);
$("#edit-add-form").dialog({
autoOpen: true,
title: 'Insert Data',
width: $(window).width()-20,
height: $(window).height()-20,
resizeable: false,
buttons: {
'Insert' : function() {
validateLForm();
}
,
Cancel: function() {
resetAllField();
$(this).dialog('close');
}
}
});
}
});
}
这里是 addForm.phtml :
<input type="text" id="l_name" name="l_name">
<input type="file" id="l_image" name="l_image">
<input type="submit" name="upload" id="upload" value="Upload Image">
但是当我点击提交按钮时,只发布了文本输入,但文件输入没有。很奇怪吧?
非常需要你的帮助。 请注意。
【问题讨论】:
标签: jquery ajax file upload dialog