There is a function ajax request and div. I need to click on the button with html with a diva inserted into the textarea and send ajax, how to do it? Now it inserts, but does not send anything. And if you write it down in the text itself, it will send

$('.story-publisher-box form').ajaxForm({ url: SK_source() + '?t=post&a=new', beforeSend: function() { var mesA = $('.KEmoji_Input div').html(); mesA = mesA.replace("&lt;", "<"); mesA = mesA.replace("&gt;", ">"); $('.auto-grow-input').val(mesA); main_wrapper = $('.story-publisher-box'); textarea = main_wrapper.find('textarea'); inputs = main_wrapper.find('input[type="text"]'); button = main_wrapper.find('button.submit-btn'); button_default_text = button.find('span').text(); textarea.attr('disabled', true); inputs.attr('disabled', true); button.attr('disabled', true); SK_progressIconLoader(button); }, uploadProgress: function(event, position, total, percentComplete) { button .find('span').text(percentComplete + '%'); if (percentComplete == 100) { button .find('span').text('@processing@'); } }, success: function(responseText) { if (responseText.status == 200) { $('.stories-wrapper').prepend(responseText.html); } //$('.story-publisher-box form').resetForm(); main_wrapper .find('.story-text-input') .val('') .end().find('.result-container') .remove() .end().find('.input-wrapper') .find('.result-container') .remove() .end() .find('.input-result-wrapper') .empty() .end().find('input') .show() .val('') .end().find('.remove-btn') .remove() .end().find('.youtube-link') .remove() .end().slideUp(); textarea.removeAttr('disabled'); inputs.removeAttr('disabled'); button .removeAttr('disabled') .find('span').text(button_default_text); SK_progressIconLoader(button); } 

});

  • one
    Actually, I don’t see you pushing something into the value text field, so probably it doesn’t send anything. - Klimenkomud
  • Do not quite understand? - Gaioz
  • var mesA = $ ('. KEmoji_Input div'). html (); $ ('. auto-grow-input'). val (mesA); here we take and insert 5 and 8 line - Gaioz
  • So, stop, you have a button becomes disabled before sending a request. Maybe this is the problem? - Klimenkomud
  • Now I tried, did not get it, removed the disabled at all - Gaioz

0