- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
$('.order-form-popup form').on('submit', function (e) {
e.preventDefault();
var data = $(this).serializeArray(),
mainProfilesList = '',
fillingsList = '';
$('.field-name-field-eo-main-profiles .field-item').each(function () {
mainProfilesList += ('<li>' + ($(this).text()) + '</li>');
});
$('.field-name-field-eo-fillings .field-item').each(function () {
fillingsList += ('<li>' + ($(this).text()) + '</li>');
});
data.push({
name: 'profiles',
value: '<ul>' + mainProfilesList + '</ul>'
});
data.push({
name: 'fillings',
value: '<ul>' + fillingsList + '</ul>'
});
data.push({
name: 'number',
value: $('.field-name-field-eo-product-number .field-item').text()
});
data.push({
name: 'qty',
value: $('#qty-input').val()
});
data.push({
name: 'area',
value: $('.field-name-field-eo-area .field-item').text()
});
data.push({
name: 'price',
value: $('.field-name-field-eo-price-without-discount .field-item').text()
});
$.ajax({
url: location.protocol + '//' + location.hostname + '/send-message.php',
type: 'POST',
data: data,
success: function (data, textStatus) {
var msg = '<h3 id="order-form-popup-msg" style="text-align: center; margin-top: 50%;">Заявка успешно отправлена.<br /> Спасибо!</h3>'
$('.order-form-popup form, .order-form-popup-title').hide();
$('.order-form-popup').append(msg);
window.setTimeout(function () {
$('.order-form-popup, .order-form-overlay').fadeOut(500);
$('#order-form-popup-msg').remove();
$('.order-form-popup form, .order-form-popup-title').show();
}, 3500);
},
error: function (jqXHR, textStatus, errorThrown) {
//for debugging
}
});
});
Vasiliy 15.05.2014 13:31 # 0
Lure Of Chaos 16.05.2014 12:35 # 0
Vasiliy 16.05.2014 12:57 # +1
guest 16.05.2014 20:44 # +1