2012-08-31 102 views
0

我有下面的代碼,需要以某種方式使它工作。我知道你不能在另一個表格內提交一個表格,所以我想知道是否有解決方法。以另一種形式表格HTML

<form method="post" action="somepage.php"> 
<input name="textbox_question" type="text"> 

<!--and there is a lot more code for this form here --> 

     <form id="fileupload" action="upload_form/server/php/" method="POST" enctype="multipart/form-data"> 
         <div> 
        <div class="span7"><strong> 
         <span class="btn btn-success fileinput-button"> Add files... 
         <input type="file" name="files[]" multiple> 
          </span> 

         </button> 
        <br></br> 
        </strong></div> 
        </div> 
        <!-- The loading indicator is shown during file processing --> 
        <div class="fileupload-loading"></div> 
        <br> 
        <!-- The table listing the files available for upload/download --> 
        <table role="presentation" class="table table-striped"> 
        <tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"> 
        </tbody> 
        </table> 
       </form> 

    <!--and there is a lot more code for this form here --> 
    </form> 
+0

嵌套表單的預期行爲是什麼? –

+2

解決方法是使用JavaScript讀取表單的內容並使用AJAX發送它們。但是爲什麼你首先需要嵌套表單呢? – toniedzwiedz

+0

如果我沒有弄錯,嵌套的表單標籤完全從DOM中刪除(不是內容,只是標籤本身),並且瀏覽器之間的行爲會有所不同...我建議找到另一種方法來做到這一點。 –

回答

3

將內部表單放入單獨的文檔中並使用iframe嵌入。