You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
@rambo-panda just to make sure you are aware that the :file selector has been deprecated. Newer versions of jQuery will only support the standard selector e.g. input[type="file"]
The reason will be displayed to describe this comment to others. Learn more.
Issue: Progress Bar was getting filled to 100% without selecting any file.
/* i have added this patch to resolve the issue */
if($('#myfile').val() == ''){
$('#message').css('color','red');
$('#message').html('Please select a file first & then click on Upload');
return false;
}
It's working for me..
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file input type seems to be not recognized in this way:
I.E:
"input type="file" name="file_binario" id="file_binario"
$('input:file:enabled[value]') returns
["input type="file" name="file_binario" id="file_binario"]
instead
$('input[type=file]:enabled[value]') returns
[]
Any suggestion? Tnx
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to $('input[type=file]:enabled[value!=""]', this);
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$('input[type="file"]:enabled[value!==""]',this); //Will be better
// or
$('input:file:enabled[value!==""]',this); // l like
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rambo-panda just to make sure you are aware that the
:file
selector has been deprecated. Newer versions of jQuery will only support the standard selector e.g.input[type="file"]
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like $('#new-form input[type=file]:enabled[value!=""]').length returns 0 on IE even if file is selected.
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[value!=""] does not work on IE. How about this ?
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem occurs only in IE if you do not specify enctype. (enctype="multipart/form-data")
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gemorroj @drypot In Chrome [value!=""] does not work when enctype="multipart/form-data" is not specified
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current impl:
var fileInputs = $('input[type=file]:enabled:not([value=""])', this);
588306a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: Progress Bar was getting filled to 100% without selecting any file.
/* i have added this patch to resolve the issue */
if($('#myfile').val() == ''){
$('#message').css('color','red');
$('#message').html('Please select a file first & then click on Upload');
return false;
}
It's working for me..
Does anybody have any idea