Hallo, ich versuche, die Datei zum Hochladen zu machen, aber ich weiß nicht, wie man den Upload-Button auslöst.Bild mit Kartik-Datei-Eingang hochladen
Ich verwende: https://github.com/kartik-v/yii2-widget-fileinput
Mein Code:
<form class="form-horizontal form-label-left">
<div class="form-group">
<label class="control-label">Select File</label>
<input id="input-0a" class="file" type="file" data-allowed-file-extensions='["jpg", "png", "gif", "tiff", "bmp"]'>
</div>
</form>
und das Skript:
<script type="text/javascript">
$(document).ready(function() {
// CATCH RESPONSE
$("#input-0a").on('fileloaded', function(event, file, previewId, index) {
alert('i = ' + index + ', id = ' + previewId + ', file = ' + file.name);
});
});
</script>
Wenn die Datei geladen wird, ich alle Daten erhalten. Aber wie kann ich die Upload-Schaltfläche auslösen?
es nicht ... funktioniert wird diese Methode die Upload-Schaltfläche Auslösen? – BRG
finden Sie hier mehr Details. http://plugins.krajee.com/file-input-ajax-demo/6 –