I have a form input
for submitting a file and I styled it because I didn't like the native style. Now, I have a single button that when clicked, it opens up the dialog to select the file. It works fine with a single click on Firefox and Chrome but it doesn't work in IE. The button needs a double click to open up the dialog in IE.
I have tried to trigger a double click with a single click using jQuery:
$("input").click(function() {
$(this).dblclick();
});
However, it doesn't seem to work. Is there any other approach to trigger a double click for IE?
Here's the demo: http://jsfiddle.net/HAaFb/
What about something like this:
var count=0;
$("input").click(function(e) {
count++;
if(count==2){
count=0;
}else{
e.preventDefault();
}
});
DEMO: http://jsfiddle.net/HAaFb/1/
http://jsbin.com/ukotit/17/edit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With