用于清除文件上载控件的jquery [英] jquery for clearing the file upload control

查看:68
本文介绍了用于清除文件上载控件的jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

heyy ..



我正在使用jquery来验证图像..我遇到警告msg时出现问题并点击OK按钮..文件上载不是清除(在IE中)..但是在mozila它清除..我的代码。



heyy..

I am using a jquery for validation of images ..My problem when alert msg is came and click OK button ..the fileupload is not cleared(in IE) ..But in mozila it cleared..here is my code.

<script type="text/javascript">
    $(function() {
        $('#<%=fluPhoto.ClientID %>').change(
    function() {
        var a = $('#<%=fluPhoto.ClientID %>').val();
        //alert(a);
        var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];
        if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {
            $("input[attr-identity=fluPhoto]").val('');
            MessageBox("Only .jpeg, .jpg, .png, .gif, .bmp formats are allowed.", $('#<%=fluPhoto.ClientID %>'));


        }


    })
    })



</script>







我可以在验证发生后获得清除文件上传(fluPhoto)的解决方案..




can I get solution for clear the file upload(fluPhoto) after the validation occure..

推荐答案

(function(){
(function() {


('#<% = fluPhoto.ClientID %> ')。change(
function(){
var a =
('#<%=fluPhoto.ClientID %>').change( function() { var a =


('#<% = fluPhoto.ClientID %> ')。val();
// alert(a);
var fileExtension = ['jpeg','jpg','png','gif','bmp'];
if(
('#<%=fluPhoto.ClientID %>').val(); //alert(a); var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp']; if (


这篇关于用于清除文件上载控件的jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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