Bug Tracker

Opened 11 years ago

Closed 9 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:2 Changed 11 years ago by user52

UPDATE: $('#myform :file[value!=\'\']') selector works with the release of jQuery 1.3.2

comment:3 Changed 9 years ago by dmethvin

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.