sweetalert

confirm value is not returning from sweet alert service

£可爱£侵袭症+ 提交于 2019-12-01 01:05:18
Had created sweet alert as seperate service and Im injecting that inro my service This is the sweet alert service (function(){ 'use strict'; angular.module('app.services') .factory('SweetAlert', SweetAlertService); SweetAlertService.$inject = []; function SweetAlertService( ) { var swal = window.swal; //public methods var self = { swal: function ( arg1, arg2, arg3) { if( typeof(arg2) === 'function' ) { swal( arg1, function(isConfirm){ arg2(isConfirm); }, arg3 ); } else { swal( arg1, arg2, arg3 ); } }, success: function(title, message) { swal( title, message, 'success' ); }, confirm: function

sweet-alert display HTML code in text

只谈情不闲聊 提交于 2019-11-30 11:16:56
问题 I am using sweet-alert plugin to display an alert. With a classical config (defaults), everything goes OK. But when I want to add a HTML tag into the TEXT, it display <b>...</b> without making it bold. After searching for the answer, it looks like I don't have the right search word... How to make sweet alert display the text also with HTML code? var hh = "<b>test</b>"; swal({ title: "" + txt + "", text: "Testno sporocilo za objekt " + hh + "", confirmButtonText: "V redu", allowOutsideClick:

How to Add Ajax Call with sweet alert

我的未来我决定 提交于 2019-11-30 08:32:33
问题 My Ajax method looks like this $.post(url,{ ajax_call:"putDonation", addresse:addresse, phone:phone, email:email, name:name, amount:amount, amountinwords:amountinwords }).done(function(data){ console.log(data); var arr = []; try { var str = ""; //convert to json string arr = $.parseJSON(data); //convert to javascript array $.each(arr,function(key,value){ str +="<li>"+value+"</li>"; }); alert(str); $(".alert-danger").show(); $("#error").html(str); } catch (e) { swal("Jay Gayatri !", 'Donation

Uncaught (in promise) cancel using SweetAlert2

我的梦境 提交于 2019-11-30 07:56:05
问题 how do I properly escape the cancel button without throwing an error when using promises? My code throws an alert confirmation with a required checkbox. the code executes as it should to the user, but it throws an error in the console window: Uncaught (in promise) cancel //validation logic all passes...Now proceed to... else { //determine and parse Discounts var myLookup = document.getElementsByName("myLookup")[0].value; $.post( "findthem.php", {myLookup: myLookup }) .done(function(json_data)

sweet-alert display HTML code in text

China☆狼群 提交于 2019-11-30 01:46:04
I am using sweet-alert plugin to display an alert. With a classical config (defaults), everything goes OK. But when I want to add a HTML tag into the TEXT, it display <b>...</b> without making it bold. After searching for the answer, it looks like I don't have the right search word... How to make sweet alert display the text also with HTML code? var hh = "<b>test</b>"; swal({ title: "" + txt + "", text: "Testno sporocilo za objekt " + hh + "", confirmButtonText: "V redu", allowOutsideClick: "true" }); The SweetAlert repo seems to be unmaintained. There's a bunch of Pull Requests without any

sweet alert continue submitting form on confirm

只愿长相守 提交于 2019-11-29 18:13:56
问题 I've this sweetalert triggered on submit of a form. $(".swa-confirm").on("submit", function(e) { e.preventDefault(); swal({ title: $(this).data("swa-title"), text: $(this).data("swa-text"), type: "warning", showCancelButton: true, confirmButtonColor: "#cc3f44", confirmButtonText: $(this).data("swa-btn-txt"), closeOnConfirm: false, html: false }, function() { } ); }); but on clicking confirm I want it to continue submiting the form... Bad ideas come to mind, like: var confirmed = false; $("

Sweet alert timer - done function

陌路散爱 提交于 2019-11-29 14:56:35
问题 I have been playing a little with the SweetAlert plugin: Sweet alert I wanted to make a delete button, where the user gets prompted before the actual delete. When the user then presses "delete" again, is then says "done" and the user has to click "ok" again for the prompt to go away for good. SweetAlert has a timer function, so you can auto close that last "Done" prompt after a few seconds or so, which works just fine. They also have a feature, where you can implement a function to be run

How to Add Ajax Call with sweet alert

别等时光非礼了梦想. 提交于 2019-11-29 06:55:45
My Ajax method looks like this $.post(url,{ ajax_call:"putDonation", addresse:addresse, phone:phone, email:email, name:name, amount:amount, amountinwords:amountinwords }).done(function(data){ console.log(data); var arr = []; try { var str = ""; //convert to json string arr = $.parseJSON(data); //convert to javascript array $.each(arr,function(key,value){ str +="<li>"+value+"</li>"; }); alert(str); $(".alert-danger").show(); $("#error").html(str); } catch (e) { swal("Jay Gayatri !", 'Donation Sucessful', "success") $("#donation")[0].reset(); } }) I want to show a sweet Alert Warning popup

Uncaught (in promise) cancel using SweetAlert2

廉价感情. 提交于 2019-11-29 05:48:18
how do I properly escape the cancel button without throwing an error when using promises? My code throws an alert confirmation with a required checkbox. the code executes as it should to the user, but it throws an error in the console window: Uncaught (in promise) cancel //validation logic all passes...Now proceed to... else { //determine and parse Discounts var myLookup = document.getElementsByName("myLookup")[0].value; $.post( "findthem.php", {myLookup: myLookup }) .done(function(json_data){ var theResponse1 = $.parseJSON(json_data); myDiscountRate = theResponse1['ourDiscountFound']; }).then