<script type="text/javascript">
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
$('.feedback-button').click(function ()
{
var name = $('#form-name').val();
var phone = $('#form-phone').val();
var email = $('#form-email').val();
var type = $(this).attr('id');
if (name.length > 0 && phone.length > 0 && email.length > 0)
{
if (!validateEmail(email))
{
alert('Введите e-mail адрес!');
return;
}
$.ajax(
{
url: '/netcat/ajax.php?action=feedback',
method: 'post',
data: {name: name, phone: phone, email: email, msg: window.appFeedbackMsg},
cache: false,
success: function (json)
{
if (json.data == 'ok')
{
$('#form-name').val('');
$('#form-phone').val('');
$('#form-email').val('');
$('.feedback-form-row').fadeOut(150);
alert('Ваше сообщение отправлено!');
yaCounter38233635.reachGoal('zavka');
}
}
});
}
else
{
alert('Все поля обязательны к заполнению!');
}
});
</script>
<script type="text/javascript">
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
$('.feedback-button').click(function ()
{
var name = $('#form-name').val();
var phone = $('#form-phone').val();
var email = $('#form-email').val();
var type = $(this).attr('id');
if (name.length > 0 && phone.length > 0)
{
$.ajax(
{
url: '/netcat/ajax.php?action=feedback',
method: 'post',
data: {name: name, phone: phone, email: email, msg: window.appFeedbackMsg},
cache: false,
success: function (json)
{
if (json.data == 'ok')
{
$('#form-name').val('');
$('#form-phone').val('');
$('#form-email').val('');
$('.feedback-form-row').fadeOut(150);
alert('Ваше сообщение отправлено!');
yaCounter38233635.reachGoal('zavka');
}
}
});
}
else
{
alert('Все поля обязательны к заполнению!');
}
});
</script>