Answer the question
In order to leave comments, you need to log in
Adding previews for uploaded images using ajax, is it possible?
I want to make a type of preview for uploaded pictures. There is a field in the view for uploading images, it looks like this:
<?= $form->field($images, 'imagesFiles[]')->fileInput(['multiple' => true, 'accept' => 'image/*','id'=>'gallery-photo-add'])->label(false) ?>
$images->imagesFiles = UploadedFile::getInstances($images,'imagesFiles');
Answer the question
In order to leave comments, you need to log in
So do you want a preview, or a display of already uploaded ones?
You can preview without ajax https://jsfiddle.net/kj67cmuw/2/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question