点击提交清除文件字段,而不是提交表单(IE9) [英] Clicking submit clears file field instead of submitting the form (IE9)

查看:135
本文介绍了点击提交清除文件字段,而不是提交表单(IE9)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有时当用户试图提交表单时,文件上传字段 image 只是清除,没有任何反应。我似乎没有提交表格。



然后,一切正常工作的一天。错误发生在随机的天/时间。

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

我曾尝试使用Google Chrome,Firefox 6.0.2,Internet Explorer 9,8(浏览器兼容模式),7(浏览器兼容模式)在Windows 7家庭没有任何问题在我的电脑上。

这里是形式:

 < form action =/ user / imagemethod =postaccept-charset =utf-8class =form_defaultenctype =多部分/格式数据> 
< fieldset>
< ol>
< li>
< button type =submitname =savevalue =submitclass =button> Save< / button>
< / li>
< li>
< label for =image>个人资料图片< / label>< input type =fileid =imagename =image/>
< / li>
< li>
< button type =submitname =savevalue =submitclass =button> Save< / button>
< / li>
< / ol>
< / fieldset>
< / form>


解决方案

应该只有1 提交按钮每个表格
因此,保存1保存按钮为 type =submit,将另一个保存为 type =button

I got a weird error I hope you guys can help with.

Sometimes when the user tries to submit a form the file upload field image just clears and nothing happens. I doesn't seems like the form get submitted at all.

Then the day after everything works fine. The error occurs on random days/times.

First I thought it was a problem with the users computer but this happens on two different computers the customer has. One of the computers has Windows 7 professional & Internet Explorer 9. I don't have the setup on the other one.

I have tried with Google Chrome, Firefox 6.0.2, Internet Explorer 9, 8 (browser compatibility mode), 7 (browser compatibility mode) on windows 7 home with no problems at all on my computer.

Here is the form:

<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>

解决方案

There should be only 1 submit button per form. So keep 1 save button as type="submit" ,change another to type="button"

这篇关于点击提交清除文件字段,而不是提交表单(IE9)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆