Skip to content

Instantly share code, notes, and snippets.

@eLafo
Created February 28, 2014 12:06
Show Gist options
  • Save eLafo/9269997 to your computer and use it in GitHub Desktop.
Save eLafo/9269997 to your computer and use it in GitHub Desktop.
AEGON.Errors = {
call_center: function(path) {
call_center = $.get(path);
call_center.done(function(data, response) {
$.fancybox({
ajax: true,
content: data,
afterShow: function() {
AEGON.Errors.active_form();
}
});
});
},
active_form: function() {
var form = $.fancybox.inner.find('form');
form.formify();
form.on('submit', function(e) {
var t = $(this);
e.preventDefault();
if (t.parsley('validate')) {
var response = $.post(t.attr('action') + '?' + t.serialize());
t.html($('#waiting').clone().show());
response.done(function (data) {
t.html(data);
AEGON.Errors.active_form();
});
}
return false;
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment