D
D
del9937882015-10-04 14:50:17
css
del993788, 2015-10-04 14:50:17

How to find out the number of selected files?

Hello. I'm using the non-stock input file codepen.io/CreativeJuiz/pen/uEHeD . I screwed multiple to it, but now I don’t understand. How can I display the number of files selected by the user? type: you have selected 3 files.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
amatory10, 2015-10-04
@del993788

you hang on input onchange="get_files()"
and in js function:

function get_files() {
    var upload = document.getElementById('file');
    alert('You upload ' + upload.files.length + ' files');
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question