To make the ability add a photo in another form?

When you add a post there input adding a photo I can't put the same input in a different form post edit

The form itself, add post

<div class="form-group" id="photo-form">
 <label class="col-md-3"></label> 
 <div class="col-md-6">
 <input type="text" class="form-control input-md" readonly>
</div>
</div>
 <div class="publisher-hidden-option">
 <div id="progress">
 <span id="percent">0%</span>
 <div class="progress">
 <div id="bar" class="progress-bar progress-bar-striped active"></div> 
</div>
 <div class="clear"></div>
</div>
 </div>


and JS

$(function() {
 $("#publisher-photos").change(function () {
 var numFiles = this.files.length;
 $("#photo-form input").val(numFiles + 'photo(s) selected');
$("#photo-form").slideDown(200);
});
 var bar = $('#bar');
 var percent = $('#percent');
 var status = $('#status');
 var publisher_button = $('#publisher-button');
$('form.create-album-form').ajaxForm({
 url: Wo_Ajax_Requests_File() + '?f=products&s=edit',
 beforeSend: function() {
 var percentVal = '0%';
bar.width(percentVal);
percent.html(percentVal);
Wo_progressIconLoader($('form.create-album-form').find('button'));
},
 uploadProgress: function (event, position, total, percentComplete) {
 var percentVal = percentComplete + '%';
bar.width(percentVal);
$('#progress').slideDown(200);
 if(percentComplete > 50) {
percent.addClass('white');
}
percent.html(percentVal);
},
 success: function(data) {
 if (data.status == 200) {
 window.location.href = data.href;
 } else {
 var errors = data.errors.join("<br>");
 $('.app-general-alert').html('<div class="alert alert-danger">' + errors + '</div>');
$('.alert-danger').fadeIn(300);
}
Wo_progressIconLoader($('form.create-album-form').find('button'));
}
});
 });


THE SECOND FORM OF EDITING WHERE YOU ACTUALLY NEED TO ROLL OUT ADD A PHOTO


Input

<div class="modal-body edit-textarea<?php echo $wo['story']['id'];?>">
 <textarea class="form-control" placeholder="Edit Post" dir="auto" id="asd" rows="6"><?php echo $wo['story']['Orginaltext']?></textarea>
 </div>


and JS

// open post edit modal
Wo_OpenPostEditBox function(post_id) {
 var edit_box = $('#post-' + post_id).find('#edit-post');
edit_box.modal({
 show: true
});
}

// save edited post
Wo_EditPost function(post_id) {
 var post = $('#post-' + post_id);
 var edit_box = $('#post-' + post_id).find('#edit-post');
 var edit_textarea = post.find('.edit-textarea-' + post_id + 'textarea');
 var text = edit_textarea.val();
 var post_text = post.find('.post-description p');
Wo_progressIconLoader(post.find('#edit-post-button'));
 $.post(Wo_Ajax_Requests_File() + '?f=posts&s=edit_post', {
 post_id: post_id,
 text: text
 }, function (data) {
 if(data.status == 200) {
post_text.html(data.html);
edit_box.modal('hide');
}
Wo_progressIconLoader(post.find('#edit-post-button'));
 if (data.can_send == 1) {
Wo_postText();
}
});
}


Tried to insert input to add the js code from 1 form but nothing loads (*(
August 19th 19 at 22:36
0 answer

Find more questions by tags AJAXJavaScriptjQuery