T
Tim Slattery
I've used a script provided by Stickman (http://www.the-stickman.com),
which allows a variable number of files to be uploaded from an HTML
page. In a nutshell, when a file is selected, it hides that <input
type="file"...> element, puts the name of the file selected in text on
the page, and creates a new <input...> element. A bit klunky, but it
works.
I've now tested this on IE6, IE7, Firefox, Safari (3.0 for Windows, I
haven't got the Mac version to go yet), and they have no problem with
it. But Opera does.
I include an external javascript file ("mutifile.js") in the head
section of my HTML page. The first thing in this script is
function MultiSelector( list_target, max ){
which defines the MultiSelector object. Way down toward the bottom of
the page is a short javascript block which invokes this object:
<script type="text/javascript">
<!-- Create an instance of the multiSelector class, pass it
the output target and the max number of files -->
var multi_selector = new
MultiSelector(document.getElementById('files_list'), 0);
<!-- Pass in the file element -->
multi_selector.addElement(document.getElementById('fname'));
</script>
Opera gives this message:
Reference to undefined variable: MultiSelector
Why doesn't Opera know what this object is?
which allows a variable number of files to be uploaded from an HTML
page. In a nutshell, when a file is selected, it hides that <input
type="file"...> element, puts the name of the file selected in text on
the page, and creates a new <input...> element. A bit klunky, but it
works.
I've now tested this on IE6, IE7, Firefox, Safari (3.0 for Windows, I
haven't got the Mac version to go yet), and they have no problem with
it. But Opera does.
I include an external javascript file ("mutifile.js") in the head
section of my HTML page. The first thing in this script is
function MultiSelector( list_target, max ){
which defines the MultiSelector object. Way down toward the bottom of
the page is a short javascript block which invokes this object:
<script type="text/javascript">
<!-- Create an instance of the multiSelector class, pass it
the output target and the max number of files -->
var multi_selector = new
MultiSelector(document.getElementById('files_list'), 0);
<!-- Pass in the file element -->
multi_selector.addElement(document.getElementById('fname'));
</script>
Opera gives this message:
Reference to undefined variable: MultiSelector
Why doesn't Opera know what this object is?