bootbox

Prevent bootbox from closing pop-up window

佐手、 提交于 2019-12-10 02:47:30
问题 I am using bootbox to make pop-up windows with forms and I have to validate them and throw error to user if something is wrong with the form fields. But I cannot prevent bootbox window from closing after user clicks ' Send ' button. I need to show error notifications to user, so errors could be corrected and the form be sent again. return false works ok, but after it I cannot find method, to restore usual method of bootbox to close the windows. Does somebody faced the same problem and how you

Chosen dropdown list not working with Modal

夙愿已清 提交于 2019-12-07 05:32:14
问题 I am trying to get a jQuery Chosen select / dropdown list to work in a Bootbox modal. I have almost the same exact code working on a standard HTML page, so I thought it would be straight forward to just pop my list into a modal. I generate my divs and select objects in the modal, and then after it is "shown", I call Chosen: div.on("shown", function() { $(".chzn-select").chosen(); $(".chzn-select-deselect").chosen({allow_single_deselect:true}); myApp.init(); }); After this, Chosen seems to be

Chosen dropdown list not working with Modal

邮差的信 提交于 2019-12-05 08:36:32
I am trying to get a jQuery Chosen select / dropdown list to work in a Bootbox modal. I have almost the same exact code working on a standard HTML page, so I thought it would be straight forward to just pop my list into a modal. I generate my divs and select objects in the modal, and then after it is "shown", I call Chosen: div.on("shown", function() { $(".chzn-select").chosen(); $(".chzn-select-deselect").chosen({allow_single_deselect:true}); myApp.init(); }); After this, Chosen seems to be broken. The select items are grayed out--I cannot click them. Inside myApp.init(), I populate the

Bootbox callback not working properly

心已入冬 提交于 2019-12-05 04:23:23
I'm trying to use this: $('#delete').live('click',function(){ var result; bootbox.confirm("Are you sure?", function(response){ result=response; }); alert(result); return result; }); But when the button is clicked: Alert is shown first and only after that bootbox shows confirm dialog. I want to return the response , but if i do it from within call back it doesn't work because it returns response from callback but not $('#devicedelete').live('click',function(){}); Btw i'm trying to submit a form basing on response. So if i return 'true' form will be submitted, else if it returns 'false', form

Prevent bootbox from closing pop-up window

好久不见. 提交于 2019-12-05 03:14:06
I am using bootbox to make pop-up windows with forms and I have to validate them and throw error to user if something is wrong with the form fields. But I cannot prevent bootbox window from closing after user clicks ' Send ' button. I need to show error notifications to user, so errors could be corrected and the form be sent again. return false works ok, but after it I cannot find method, to restore usual method of bootbox to close the windows. Does somebody faced the same problem and how you get rid of this situation? As asked, fsFiddle : <button id="test">Bootbox</button> Code: $(document)

How to confirm a form submission with Bootbox using jQuery AJAX and JSON

流过昼夜 提交于 2019-12-05 00:30:33
问题 I'm working in a web application using Spring MVC . I'm trying to show a confirmation dialog before submitting a form using Bootbox , but I'm getting a 500 internal server error. This is my form: <form id="checkout-form" class="smart-form" novalidate="novalidate"> ...some fields <button type="button" class="btn btn-primary" onclick="insertFunction()"> Accept </button> </form> This is my insertFunction() function insertFunction(){ var name = $('#name').val(); var lastname = $('#lastname').val(

Bootbox dialog inside dialog

余生颓废 提交于 2019-12-04 06:05:08
问题 I was recently assigned to a project using bootbox and one of my current issues is opening another dialog after one is already opened. The problem is that background shadow doesn't cover the first dialog after the second is opened. Is there a way to open the second dialog covering up the first? EDIT function Confirm(question, callBack) { bootbox.confirm(question, callBack); } If executed twice it will show the two popups, but the first won't be covered in shadow. 回答1: From the Bootstrap docs

Bootbox Confirm Dialog problems

做~自己de王妃 提交于 2019-12-03 16:21:35
问题 Unfortunately, the doc Bootbox ( http://paynedigital.com/2011/11/bootbox-js-alert-confirm-dialogs-for-twitter-bootstrap ) not teach how to call the confirm dialog. As it is in the doc window always appears when the page is loaded, what is wrong, should appear when called by clicking on a delete button. This is the code that tried unsuccessfully. // show "false" does not work, the confirm window is showing when page is loaded. $(function () { bootbox.confirm("Confirm delete?", "No", "Yes",

How to confirm a form submission with Bootbox using jQuery AJAX and JSON

大憨熊 提交于 2019-12-03 15:37:09
I'm working in a web application using Spring MVC . I'm trying to show a confirmation dialog before submitting a form using Bootbox , but I'm getting a 500 internal server error. This is my form: <form id="checkout-form" class="smart-form" novalidate="novalidate"> ...some fields <button type="button" class="btn btn-primary" onclick="insertFunction()"> Accept </button> </form> This is my insertFunction() function insertFunction(){ var name = $('#name').val(); var lastname = $('#lastname').val(); var confirmSend; var json = {"name": name,"lastname": lastname}; $.ajax({ type: "POST", url:

Bootbox confirm: return client result in order to do postback to rowCommand

半城伤御伤魂 提交于 2019-12-03 08:56:55
Before bootbox, I did this on aspx file in gridview; <asp:Button ID="btnDelete" CssClass="btn btn-danger" OnClientClick="if(!confirmDelete()) return false;" runat="server" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" CausesValidation="false" CommandName="DeleteRow" Text="Delete"/> and on js file; function confirmDelete() { return confirm("Are you sure you want to delete the record?"); } And with confirmation, the gridview's RowCommand is triggered and the deletion is done. With bootbox, I am realy stuck. I know bootbox is asynchronus and try to use 'preventDefault', but it didn