2011-08-16 49 views
0

我很瞭解嵌套窗體是無效的,我正在用php構建一個簡單的窗體,並且需要包含另一個窗體來控制ajax圖像上傳框,以便我可以將文件路徑送入原始窗體。嵌套窗體解決方法

下面的示例代碼;

<form> 
    <fieldset> 
     <input> 
    </fieldset> 
    <fieldset> 
     <input> 
    </fieldset> 
    <form action="js/ajaxupload.php" method="post" name="sleeker" id="sleeker" enctype="multipart/form-data"> 
     <input type="hidden" name="maxSize" value="9999999999" /> 
     <input type="hidden" name="maxW" value="400" /> 
     <input type="hidden" name="fullPath" value="http://192.168.10.10:8080/intranet/dashboard/uploads/" /> 
     <input type="hidden" name="relPath" value="../uploads/" /> 
     <input type="hidden" name="colorR" value="255" /> 
     <input type="hidden" name="colorG" value="255" /> 
     <input type="hidden" name="colorB" value="255" /> 
     <input type="hidden" name="maxH" value="200" /> 
     <input type="hidden" name="filename" value="filename" /> 
     <input type="file" name="filename" style="float:left; width:40% !important;" onchange="ajaxUpload(this.form,'js/ajaxupload.php?filename=name&amp;maxSize=9999999999&amp;maxW=200&amp;fullPath=http://192.168.10.10:8080/intranet/dashboard/uploads/&amp;relPath=../uploads/&amp;colorR=255&amp;colorG=255&amp;colorB=255&amp;maxH=300','upload_area','File Uploading Please Wait…&lt;br /&gt;&lt;img src=\'images/loader_light_blue.gif\' width=\'128\' height=\'15\' border=\'0\' /&gt;','&lt;img src=\'images/error.gif\' width=\'16\' height=\'16\' border=\'0\' /&gt; Error in Upload, check settings and path info in source code.'); return false;" /> 
    </form> 
    <fieldset> 
     <input> 
    </fieldset> 
    <fieldset> 
     <input> 
    </fieldset> 
<submit> 
</form> 

在以前的項目我剛纔放在原來的形式下面的圖片上傳喂隱藏的輸入回原來的形式,遺憾的是,不會爲這個項目是可行的,

任何想法繞過這個問題將不勝感激!

+0

如果您僅使用ajax控件,則不需要表單。控件可以在外部形式 – Einacio

+0

@einacio你可以進入更多的細節,我的阿賈克斯經驗是完全調整在線的例子,所以不確定哪個控制你的轉診 – Xand94

+0

爲什麼你不能「將圖像上傳到原始形式下, [feed]隱藏的輸入回到原始形式「? –

回答

0

是否有任何系統將External_form.pl解析爲Internal_form.pl。例如:

  1. Form.html

    <html> 
    .... 
    .... 
    <form ... method="post" action="External_form.pl"> 
    .... 
    .... 
    </form> 
    

    此表單提交值External_form.pl

  2. External_form.pl

    它驗證Posted_Data並再次發送該值來另一種形式Internal_Form.pl

  3. Internal_Form.pl

    它最終將數據發送到(External.pl或Form.html)並在後端處理驗證的日期。

+2

您是否發佈了答案或提問?如果有答案,請在您的帖子中添加詳細信息,以便原始提問者可以使用您的信息;如果有問題,請點擊提問按鈕將其作爲問題發佈。 –