I have this code
<input id="fileupload"
type="file" name="files[]"
class="inputFile clickable"
onchange="uploadFile(this.value)"/>
This works fine on second time using it, i.e. first time I select the file the onchange event does not fire, but selecting file for the second time works fine.
Is there any thing which I can change here?
I have tried:
onlclick(doesn't work, fires before selecting file)onblur(doesn't work, doesn't fire at all, plus even if does, its just stupid to click somewhere else on page to fire the operation)onselect(doesn't work)
Additional info:
If I use onchange=alert(this.value) it works fine
this is my javascript code
function uploadFile(value) {
alert(value); //works fine
$('#fileupload').fileupload({
dataType: 'json',
url: 'fileUpload.php',
type: 'POST',
limitConcurrentUploads: 1,
// done: function (e, data) {
// $.each(data.result, function (index, file) {
// $('<p/>').text(file.name).appendTo(document.body);
// });
// },
success: function() {
showMultipleDataDiv(value); //but I don't get value here
}
});
}