|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Document.form.fileinput.click() in FF, NN, Opera Exc...
I have tried the following to open a browse window...
in IE the following works... window.document.formname.fileinputname.click(); it opens the browse window, in FF this doesnt work. how can i get the same job done in FF? colton22
__________________
![]() Hang Out, Listen To Music, Have Fun, and Customize Your Experiance All In One Place! - Colton22's World - This is My World |
|
#2
|
||||
|
||||
|
Is it necessary that you use your form object?
Would window.open() help you out at all? On second glance, is this a browser window, or a file-selecting-dialog-thing?
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
||||
|
||||
|
<FORM NAME="info"><INPUT TYPE="file" NAME="val"></FORM>
in IE, window.document.info.val.click() opens a browse box for the user to click on a file, in FF this fails to open a browse box. im trying to do what can happen in IE in FF, open the browse box for the user. colton22 ps sorry i wasnt clear earlier |
|
#4
|
||||
|
||||
|
file browse dialog in Firefox
Maybe if you used something like
Code:
var file_input = document.getElemenById('val');
file_input.click();
|
|
#5
|
||||
|
||||
|
when i do that im not getting any error in the javascript counsole, but nothings happening yet.
any more suggestions? colton22 |
|
#6
|
||||
|
||||
|
file input
I tried this (after adding the missing "t" to element)
Code:
<html>
<head>
<script type="text/javascript">
function getFile(){
var file_input = document.getElementById('val');
file_input.click();
}
</script>
</head>
<body>
<FORM NAME="info" method="post" enctype="multipart/form-data"><INPUT TYPE="file" NAME="val" id="val" /></FORM>
<input type="button" value="getFile" onclick="getFile();" />
</body>
</html>
I thought it might have something to do with event bubble/capture but Opera does both so now I wonder if the "browse" button is "bound" to the file input object in IE and takes the click, but isn't in the others. I wonder if there's a way to create a file object without needing to pass a click to it? |
|
#7
|
||||
|
||||
|
yes, currently i have the browse button on my FF,NN,Opera parts of my website.
check it out in IE, FF, NN (FF, NN, Exc. will be the same, IE wont) http://www.freewebs.com/colton22/index.html currently it will redirect you in 12 seconds but you could click the lowest link, the only difference is home.html not index.html. when the home.html file is viewed in IE (best viewed in IE) under the playlist dropdown, the second one is "Browse For File..." if you click that a browse box will appear, select a file, playing the file is not set up yet, in FF, when you click "Browse for file...", that same area gets the "innerHTML" task on it and becomes a browse input field and a play button. colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Document.form.fileinput.click() in FF, NN, Opera Exc... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|