Newsletter subscription with ajax

This commit is contained in:
touffies
2013-10-22 22:26:33 +02:00
parent f844080758
commit ac70075a38
8 changed files with 74 additions and 59 deletions

View File

@@ -89,6 +89,32 @@
}).find(':radio:checked').trigger('change.account');
}
// Mini Newsletter Subscription
var $form_newsletter = $('#form-newsletter-mini');
if($form_newsletter.size() > 0) {
$form_newsletter.on('submit.newsletter', function(){
$.ajax({
url: $(this).attr('action'),
type: $(this).attr('method'),
data: $(this).serialize(),
dataType: 'json',
success: function(json) {
var $msg = '';
if(json.success){
$msg = json.message;
}else{
$msg = json.message;
}
bootbox.alert($msg);
}
});
return false;
});
}
// Forgot Password
/*
var $forgot_password = $('.forgot-password', $form_login);