Imagefield: automatically transfer file on selection without clicking upload button
Note committed on 03 April 2011, tagged drupal, drupal 6, js
I wanted file to be uploaded automatically after selecting it, without having to press the Upload button:

Here my solution to this problem, which seems to be working better than the one in the filefield issue queue on d.o:
Drupal.behaviors.Autoupload = function(context) {
$(context, '.filefield-upload input.form-file').change(function(context) {
$(context.target).parent().find('input.form-submit:not(.au)').addClass("au").mousedown();
});
}
$(context, '.filefield-upload input.form-file').change(function(context) {
$(context.target).parent().find('input.form-submit:not(.au)').addClass("au").mousedown();
});
}
======= Add new comment =======