Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bootbox Ajax
$('.open-modal-btn').click(function(e){
$that = $(this);
e.preventDefault();
$.ajax({
url: $that.attr('href'),
type: 'POST',
dataType: 'json',
success: function(data){
bootbox.dialog({
message: data.message,
title: data.title,
buttons: {
success: {
label: data.submit,
className: "btn-primary",
callback: function() {
$('#create-ticket-form').submit();
}
},
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment