Answer the question
In order to leave comments, you need to log in
How to upload an image only to the block in which it was selected?
The bottom line is that on the page with adding posts there is a button for adding another form for adding a post, and I need it so that when uploading a photo or video to one post, it does not appear in another
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('.left-part-new-post').find('.preload-img').attr('src', e.target.result);
};
reader.readAsDataURL(input.files[0]);
}
}
$(".add-file-post").change(function () {
readURL(this);
$('.main-form').remove();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question