JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 25th, 2006, 06:57 PM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
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

Reply With Quote
  #2  
Old November 27th, 2006, 08:01 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old November 27th, 2006, 10:05 AM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
<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

Reply With Quote
  #4  
Old November 27th, 2006, 07:09 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 548 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 6 h 35 m 44 sec
Reputation Power: 4
file browse dialog in Firefox

Maybe if you used something like
Code:
var file_input = document.getElemenById('val');
file_input.click();

Reply With Quote
  #5  
Old November 27th, 2006, 07:14 PM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
when i do that im not getting any error in the javascript counsole, but nothings happening yet.

any more suggestions?

colton22

Reply With Quote
  #6  
Old November 29th, 2006, 10:22 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 548 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 6 h 35 m 44 sec
Reputation Power: 4
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>
It works in IE, but not Firefox or Opera
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?

Reply With Quote
  #7  
Old November 30th, 2006, 06:17 AM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 472 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 14 m 46 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Document.form.fileinput.click() in FF, NN, Opera Exc...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway