Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Created March 22, 2016 10:10
Show Gist options
  • Save hsleonis/2b0784292602d6fae48f to your computer and use it in GitHub Desktop.
Save hsleonis/2b0784292602d6fae48f to your computer and use it in GitHub Desktop.
Dynamic content in Bootbox JS with AJAX request
bootbox.dialog({
title: "This is a AJAX Form from external file.",
data: {'user':'dc','task':'get'},
datauri: 'ajax.html',
buttons: {
success: {
label: "Save",
className: "btn-success",
callback: function () {
var name = $('#name').val();
var answer = $("input[name='awesomeness']:checked").val()
Example.show("Hello " + name + ". You've chosen <b>" + answer + "</b>");
}
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment