' + data,
buttons: [{
text: T('Send'),
click: function() {
if ($('.emailProductLinkForm .errorInput').length) {
$('#dialogErrors').html(T('Please correct the errors in the form.'));
} else {
var rlProdNum = $('.emailProductLinkForm').find('input[name="rlProdNum"]').val();
$('#dialogErrors').html('');
$.ajax({
url: getAjaxURL('/emailProductLinkAjax'),
type: 'post',
dataType: 'json',
data: $('.emailProductLinkForm').serialize(),
success: function(data) {
if (data.success == 1) {
var trackOpts = {
type: 'event',
category: 'product',
action: 'emailProductLink',
value: rlProdNum
};
trackEvent(trackOpts);
showDialog({
title: T('Email Product Link'),
content: T('Product Link sent successfully'),
buttons: [{
text: T('Ok'),
click: function() {
closeDialog();
}
}]
});
} else {
$('#dialogErrors').html(data.error);
}
},
error: function(e, status) {
$('#dialogErrors').html(T('There was an error while sending the product link'));
}
});
}
},
},
{
text: T('Cancel'),
click: function() {
closeDialog();
}
}]
});
$('.emailProductLinkForm').validate({ realTime: true });
$('.emailProductLinkForm input').keypress(function(event) {
//disable enter key
if (event.keyCode == 13) {
event.preventDefault();
}
});
},
error: function() {
showError();
}
});
return (false);
});
});