var request = new XMLHttpRequest(),
type = 'POST',
data = {u:"type=1s&mbet=47&kolvos=12&diams=300&visotas=300&diamss=400&visotass=20&shirinalenty=6&dlinalenty=8&visotalenty=70&tolshinalenty=40&dlinalenty2=4&dlinasterjna=11.7&sdoski=15&ddoski=600&tdoski="};
request.open(type, 'http://test.ru', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(data);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('a[href^="#"]').on('click',function(e) {
e.preventDefault();
var target = this.hash,
$target = $(target),
$calculus = ( $target.offset().top - 75 ),
$target_to = $calculus.toFixed();
$('html, body').stop().animate({
'scrollTop': ($target_to+'px')
}, 900, 'swing');
});
});
</script>
<form id="form" action="{% url 'documents:print_documents'%}" method="POST" target="_blank">
<input class="select-inv-check" data-id="123" type="checkbox">123
<input class="select-inv-check" data-id="456" type="checkbox">456
<input class="btn btn-sm btn-default print-all-btn" id="printAll" type="submit" name="send" value="Распечатать">
</form>
$( "#form" ).submit(function( event ) {
var id = [];
$('input.select-inv-check:checked').each(function() {
id.push($(this).data('id'));
});
if (id.length != 0) {
id.forEach(function(item, i) {
var elInput = document.createElement("input");
elInput.setAttribute('type', 'hidden');
elInput.setAttribute('name', 'doc_ids[]');
elInput.setAttribute('value', '');
elInput.value = id[i];
$("#form").append(elInput);
});
return;
}
event.preventDefault();
});