1
我遇到輕微問題。如何使用OnChange將提交和表單目標添加到iFrame
我已將我的<input type="file">
設置爲onChange="this.form.submit()"
。
文件選擇器將觸發提交,但是如果我將我的<form>
元素定位到iFrame,瀏覽器將返回彈出式窗口阻止錯誤並停止提交!
.submit()
工作正常,沒有指定目標 - 但只要我有目標,它會阻止它!
有沒有解決這個問題的方法?
謝謝。
編輯: 這裏是HTML:
<iframe src="about:blank" title="uploader_iframe" id="uploader_iframe" style="display:block;"></iframe>
<form target="uploader_iframe" action="upload.php" id="the_form" onsubmit="return validate()" method="post" enctype="multipart/form-data"><input type="file" id="beta_uploader" size="1" onchange="document.forms['the_form'].submit()" name="file" /></form>
此外,驗證()函數沒有被調用:S
到Specifiy的IFRAME我交換形式(),並提交給你的。你也可以發佈表單標籤嗎? – mplungjan 2011-05-30 15:52:41