By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Coloring input type=input browse button; uploading multiple files

P: n/a
Good afternoon.

The entire task that I'm trying to achieve is to allow a user to browse and
upload multiple files simultaneously, hiding the Browse button of <input>
tags of type="file" and replacing it with a button of my own background
color and text.

The file paths I'd like displayed in a textarea and then the files uploaded
at once.

The code chunks toward my goal I got from the Web (below) I think worked
before IE 5.0 but for me produces an "Access Denied" error.

Can anybody help with any part of my problem (coloring the browse button,
listing multiple chosen files in a textarea, uploading an artibrary number
of files at once)?

Thanks, Ron.

Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
1) You cannot change the button that is displayed next to the input field,
BUT
what you can do is put it in a <DIV> or <SPAN> and clip the button
off --> style= width:XXpx;overlow:hidden blah blah...

2) Invoking the browse dialog can be done by calling the "click()" event on
that field
--> <button onclick="fileBrowse.click()">click here</button> where
"fileBrowse" is the name of that field...
3) You cannot place a value into that field, because the browse control
needs to specifically get the file info loaded into that form field
(fileBrowse i mean),
BUT, you CAN read the value that is placed in that field after the user
browses and selects their file...SO
you CAN then take that value and place it wherever, in a textarea or list or
whatever...but UNDERSTAND that you cannot do anything with that...

4) As for mutliple file uploading... :0)
option 1: Dynamically create a new input field
option 2: Show a max of 10 fields(although this wastes space...)

5) if you go for option 1 (i hope)
it mean you show eg. <input type="file" name="file_1">
if the user has selected his file you extract the value from -->
document.formname.file_1.value and put it in your list.
The hide that box as is, and create a new one
aaaargh....

mail me if you want this code,
too much to explain...need coffee, but a brilliant idea for uploading
mutliple files tho!!

thanks!

Dominique
"Ron Brennan" <rb******@magma.ca> wrote in message
news:yp********************@magma.ca...
Good afternoon.

The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input>
tags of type="file" and replacing it with a button of my own background
color and text.

The file paths I'd like displayed in a textarea and then the files uploaded at once.

The code chunks toward my goal I got from the Web (below) I think worked
before IE 5.0 but for me produces an "Access Denied" error.

Can anybody help with any part of my problem (coloring the browse button,
listing multiple chosen files in a textarea, uploading an artibrary number
of files at once)?

Thanks, Ron.

Jul 23 '05 #2

P: n/a
1) You cannot change the button that is displayed next to the input field,
BUT
what you can do is put it in a <DIV> or <SPAN> and clip the button
off --> style= width:XXpx;overlow:hidden blah blah...

2) Invoking the browse dialog can be done by calling the "click()" event on that field
--> <button onclick="fileBrowse.click()">click here</button> where
"fileBrowse" is the name of that field...
3) You cannot place a value into that field, because the browse control
needs to specifically get the file info loaded into that form field
(fileBrowse i mean),
BUT, you CAN read the value that is placed in that field after the user
browses and selects their file...SO
you CAN then take that value and place it wherever, in a textarea or list or whatever...but UNDERSTAND that you cannot do anything with that... -----------------------------
I've been trying this approach, and haven't gotten it to work for me. I
think it might work for pre-IE 5, but not later. I'll see if there is a
nuance in your code that's different than from mine
----------------------------- 4) As for mutliple file uploading... :0)
option 1: Dynamically create a new input field
option 2: Show a max of 10 fields(although this wastes space...)

5) if you go for option 1 (i hope)
it mean you show eg. <input type="file" name="file_1">
if the user has selected his file you extract the value from -->
document.formname.file_1.value and put it in your list.
The hide that box as is, and create a new one
aaaargh....

mail me if you want this code,

--------------------------------
Yes, please, please send me the code for option 1. It's exactly what I want
to do.

rb******@magma.ca
Jul 23 '05 #3

P: n/a
I was so excited to find what I was looking for, I forgot my manners.

Thank you very much,
Ron.

Jul 23 '05 #4

P: n/a
Dominique,

My e-mail to you this evening bounced back becuase you've exceeded your
e-mail capacity.

Ron.

"Dominique" <ni****@webadstudio.com> wrote in message
news:c7**********@ctb-nnrp2.saix.net...
1) You cannot change the button that is displayed next to the input field,
BUT
what you can do is put it in a <DIV> or <SPAN> and clip the button
off --> style= width:XXpx;overlow:hidden blah blah...

2) Invoking the browse dialog can be done by calling the "click()" event on that field
--> <button onclick="fileBrowse.click()">click here</button> where
"fileBrowse" is the name of that field...
3) You cannot place a value into that field, because the browse control
needs to specifically get the file info loaded into that form field
(fileBrowse i mean),
BUT, you CAN read the value that is placed in that field after the user
browses and selects their file...SO
you CAN then take that value and place it wherever, in a textarea or list or whatever...but UNDERSTAND that you cannot do anything with that...

4) As for mutliple file uploading... :0)
option 1: Dynamically create a new input field
option 2: Show a max of 10 fields(although this wastes space...)

5) if you go for option 1 (i hope)
it mean you show eg. <input type="file" name="file_1">
if the user has selected his file you extract the value from -->
document.formname.file_1.value and put it in your list.
The hide that box as is, and create a new one
aaaargh....

mail me if you want this code,
too much to explain...need coffee, but a brilliant idea for uploading
mutliple files tho!!

thanks!

Dominique
"Ron Brennan" <rb******@magma.ca> wrote in message
news:yp********************@magma.ca...
Good afternoon.

The entire task that I'm trying to achieve is to allow a user to browse

and
upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background
color and text.

The file paths I'd like displayed in a textarea and then the files

uploaded
at once.

The code chunks toward my goal I got from the Web (below) I think worked
before IE 5.0 but for me produces an "Access Denied" error.

Can anybody help with any part of my problem (coloring the browse button, listing multiple chosen files in a textarea, uploading an artibrary number of files at once)?

Thanks, Ron.


Jul 23 '05 #5

P: n/a
JRS: In article <Wr********************@magma.ca>, seen in
news:comp.lang.javascript, Ron Brennan <rb******@magma.ca> posted at
Thu, 13 May 2004 21:05:07 :
Lines: 82
Dominique,

My e-mail to you this evening bounced back becuase you've exceeded your
e-mail capacity.

Ron.

"Dominique" <ni****@webadstudio.com> wrote in message
news:c7**********@ctb-nnrp2.saix.net...
... ...


Which should help to remind you not to quote the whole of a previous
message, which wastes everyone's resources. FAQ 2.3 para 6, FYI28.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.