Wednesday, 15 June 2011

javascript - Disable the Bootbox close button -



javascript - Disable the Bootbox close button -

i'm wondering how remove "x" button shows on bootbox alerts, confirms, prompts , dialogs.

there cases you'd wish require user provide response--not dismiss pop-up click on "x" button.

does have thought of how remove button?

i ended finding solution, , easy (but doesn't seem in current bootbox documentation.)

the solution works bootbox dialogs, if need remove "x" other types of boxes, i'd suggest imitating other, more primitive types of boxes dialog.

the solution, uses closebutton: false, seen in snippet below:

bootbox.dialog({ closebutton: false, title: "woah acts alert", message: "cool info you. must click ok.", buttons: { success:{ label: "ok", callback: callback } } }); callback(){//stuff happens when click ok.}

by making sure user must click on button dismiss box, can create sure trigger appropriate callback function.

javascript twitter-bootstrap bootbox

No comments:

Post a Comment