jQuery自动提交-表单类型文件 [英] Jquery automatic submit - form type file

查看:86
本文介绍了jQuery自动提交-表单类型文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索一个jQuery脚本,该脚本在自动提交表单时会选择一个文件.

I am searching for a jQuery script that selects a file when the form is automatic submitted.

推荐答案

为输入文件控件尝试.change()事件.像

Try .change() event for the input file control. Something like

<form action="test.html" id="form1">
    <input type="file" id="fil1" />
</form>

$(function(){
    $("#fil1").change(function(){
        $("#form1").submit();
    });
});

这篇关于jQuery自动提交-表单类型文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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