#9954 closed bug (worksforme)
jquery does not trigger default events in chrome
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | |
Component: | event | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
For instance, this code will show the file input dialog in firefox, but will not in chrome
html:
<input type="file" id="file" /> <span id="triger">click me</span>
javascrip:
$('#trigger').click(function(){
$('#file'].click();
});
Change History (6)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → event |
---|---|
Milestone: | None → 1.6.3 |
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
comment:3 follow-up: 4 Changed 11 years ago by
You can't force the file dialog to open, at least not without some serious workarounds: http://stackoverflow.com/questions/210643/in-javascript-can-i-make-a-click-event-fire-programmatically-for-a-file-input-e
comment:4 Changed 11 years ago by
Replying to ajpiano:
You can't force the file dialog to open, at least not without some serious workarounds: http://stackoverflow.com/questions/210643/in-javascript-can-i-make-a-click-event-fire-programmatically-for-a-file-input-e
This code works for me either in firefox 5.0 as in chromium 12.0.742.112
<html> <body>
<input id="file" type="file"/> <a href="#" onClick="document.getElementById('file').click();">Click me</a>
</body> </html>
comment:5 Changed 11 years ago by
If the form has display:none; chrome doesn't show the dialog, but if the form has not display:none; chrome does.
It is a chrome thing thought.
The problem is that unpespected behaivour brokes the jquery's cross-browserality.
comment:6 Changed 11 years ago by
Milestone: | 1.6.3 |
---|
That code can't possibly work at all - there are several syntax errors.