Opened 14 years ago
Closed 12 years ago
#4083 closed bug (worksforme)
selector :file value works in 1.2.6
Reported by: | user52 | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | selector | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$('#myform :file[value!=\'\']') works in 1.2.6; not in 1.3.x
Selector is looking for inputs of type file with value not empty.
Test case where "uncaught exception: Syntax error, unrecognized expression: value!=]":
<div id="myform">
<form action="test-selector.php" enctype="multipart/form-data" method="post">
<div>
<input type="file" name="file" /><br /> <input type="file" name="file" /><br /> <input type="file" name="file" /><br /> <input type="button" value="Send" onclick="submit_form();" />
</div>
</form>
</div> <!-- <script type="text/javascript" src="js/jquery-1.2.6.js"></script> --> <script type="text/javascript" src="js/jquery-1.3.1.js"></script> <script type="text/javascript"> <![CDATA[ function submit_form(){
var files=$('#myform :file[value!=\'\']'); if(files.length>0){
files.each(
function(i){
console.log(this);
}
)
} else{
alert('Select some files please');
}
} ]]> </script>
Why doesn't value expression not work in the current release?
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
UPDATE: $('#myform :file[value!=\'\']') selector works with the release of jQuery 1.3.2
comment:3 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
http://darklaunch.com/2009/02/05/jquery-file-selector-works-in-1-2-6