var alertMessage = "";
var formTemplate = Backbone.Marionette.TemplateCache.get('#myTemplate');
var formString = formTemplate({ defaultDate: moment().add(90, 'days').format('YYYYMMDD') });
// remove the newlines. Bootstrap-Dialog doesn't like them (turns them into <br>'s)
formString = formString.replace(/[\n]/g, '');
alertMessage = formString;
BootstrapDialog.show({
title: 'Alert',
message: alertMessage,
buttons: [
{
label: 'Save',
cssClass: 'btn-primary',
autospin: true,
action: function(dialogItself) {
var inputData = {};
dialogItself.$modalBody.find(':input').each( function() {
inputData[$(this).attr('name')] = $(this).val().trim();
});
App.vent.trigger("modalDialog:" + button, inputData);
setTimeout(function(){
dialogItself.close()
}, 2000);
}
},
{
label: "Cancel",
cssClass: 'btn-primary',
action: function(dialogItself){
dialogItself.close();
}
}
]
});
Created
August 12, 2014 16:37
-
-
Save GaryRogers/1ff32f3b27f4c4e52d55 to your computer and use it in GitHub Desktop.
Using Forms with Bootstrap-Dialog
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tnx, needed that