$('form').trigger('reset');
$(function() {
'use strict';
$('form').on('submit', function(e) {
e.preventDefault();
alert('Наш менеджер в скором времени свяжется с вами!');
var popupClass = $(this).attr('id').replace('form', 'popup');
$.ajax({
url: 'send.php',
type: 'POST',
contentType: false,
processData: false,
data: new FormData(this),
success: function(msg) {
console.log(msg);
if (msg == 'ok') {
console.log('Нужный класс попапа: ' + popupClass);
$('#form').trigger('reset'); // очистка формы
} else {
alert('Ошибка');
}
}
});
});
});
<?$APPLICATION->IncludeComponent(
"bitrix:catalog",
"",
Array(
"TEMPLATE_THEME" => "blue",
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "2", //Ваш новый инфоблок
/**
* И другие параметры компонента
**/
),
false
);?>