Javascript 在Vex弹出窗口中提交表单

Javascript 在Vex弹出窗口中提交表单,javascript,php,jquery,ajax,forms,Javascript,Php,Jquery,Ajax,Forms,我正在建立一个材料设计网站,当用户点击新帖子的按钮时,会打开一个弹出窗口(由Vex管理),用户可以在上面输入一些文本,添加一个文件,当他点击“Go”时,文件和消息将通过method=post推送到另一个文件 问题:Vex将表单放在所有内容之上,因此我不确定如何将所有数据提交到我的fnc_create_post.php文件。我试图通过添加一个方法、动作和enctype在外部操纵表单,但它无法推送文件 $('#new-post').on('click', function(){ ve

我正在建立一个材料设计网站,当用户点击新帖子的按钮时,会打开一个弹出窗口(由Vex管理),用户可以在上面输入一些文本,添加一个文件,当他点击“Go”时,文件和消息将通过method=post推送到另一个文件

问题:Vex将表单放在所有内容之上,因此我不确定如何将所有数据提交到我的fnc_create_post.php文件。我试图通过添加一个方法、动作和enctype在外部操纵表单,但它无法推送文件

$('#new-post').on('click', function(){
        vex.dialog.open({
          message: '<b>Neuer Beitrag</b>',
          input: '<input type="hidden" name="classid" value="<?php echo $id; ?>" /><div class="create-post input-field"><textarea name="message" style="min-height:100px" placeholder="Erstellen Sie hier Ihre Nachricht..."></textarea><div class="file-field input-field" style="display:none;"><div class="btn"><span><i class="mdi-editor-attach-file"></i></span><input name="file" id="file" type="file" /></div><div class="file-description"><i class="mdi-hardware-keyboard-arrow-left"></i> Optional Datei hinzufügen</div><div class="remove-file"><i class="mdi-action-highlight-remove small"></i></div><div class="clearfix"></div></div></div><input type="submit" style="display:none;" />',
          afterOpen: function($vexContent) {
            $('form.vex-dialog-form').attr('action', 'fnc/create_post.php').attr('method', 'POST').attr('enctype', 'multipart/form-data');
          },
          onSubmit: function(e) {

          }
        });
    });
$('newpost')。在('click',function()上{
vex.dialog.open({
信息:“Neuer Beitrag”,
输入:'你找到你的<代码>你找到你的<代码>你找到你的<代码>