jquery表单插件传递空值

时间:2012-12-29 00:06:02

标签: jquery jquery-forms-plugin

一旦点击了编辑信息按钮,我就会在面板模式窗口中显示一个隐藏的div。

<div id="editlog" style="display:none">
        <h3>Enter a new weight and/or photo.</h3>
        <form id="editlogform" action="editweight.php" method="post"  enctype="multipart/form-data">
            <input type="hidden" id="edittrigger" />
            <table width="400" cellpadding="0" cellspacing="6" border="0">
                <tr><td>New Weight.</td></tr>
                <tr><td><input type="text" name="weight" id="weight" maxlength="3" /></td></tr>
                <tr><td>New Photo</td></tr>
                <tr><td><input type="file" name="photo" /></td></tr>
                <tr><td><input type="button" value="submit" id="editlogsubmit" class="button"></td></tr>
            </table>
        </form>
    </div>

如您所见,它也会传递照片。这是提交表单的jquery。

$('#editlogsubmit').live('click', function() {
    $('#editlogform').ajaxSubmit({ 
        success: function(data) {
            alert(data.t);
        }
    });
});

我在服务器端我print_r()变量并且它们都是空的?如果我使用jquery使用id而不是名称来获取值,我只能传递一些东西。我认为这可能与div在模态中的事实有关,但我不确定。关于变量为何空的任何想法?

0 个答案:

没有答案