gpt4 book ai didi

forms - 单击提交会清除文件字段而不是提交表单 (IE9)

转载 作者:行者123 更新时间:2023-12-03 15:04:10 25 4
gpt4 key购买 nike

我遇到了一个奇怪的错误,希望你们能帮忙。

有时,当用户尝试提交表单时,文件上传字段 image只是清除,什么也没有发生。我似乎根本没有提交表单。

然后第二天一切正常。错误发生在随机的日期/时间。

首先,我认为这是用户计算机的问题,但这发生在客户拥有的两台不同计算机上。其中一台电脑有 Windows 7 专业版和 Internet Explorer 9。我没有另一台电脑的设置。

我已经在 Windows 7 home 上尝试过 Google Chrome、Firefox 6.0.2、Internet Explorer 9、8(浏览器兼容模式)、7(浏览器兼容模式),在我的电脑上完全没有问题。

这是表格:

<form action="/user/image" method="post" accept-charset="utf-8" class="form_default" enctype="multipart/form-data">
<fieldset>
<ol>
<li>
<button type="submit" name="save" value="submit" class="button">Save</button>
</li>
<li>
<label for="image">Profile image</label><input type="file" id="image" name="image" />
</li>
<li>
<button type="submit" name="save" value="submit" class="button">Save</button>
</li>
</ol>
</fieldset>
</form>

最佳答案

应该只有 1 submit buttonform .
所以保持 1 个保存按钮为 type="submit" , 将另一个更改为 type="button"

关于forms - 单击提交会清除文件字段而不是提交表单 (IE9),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7513211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com