sweetalert

sweetAlert preventDefault and return true

匆匆过客 提交于 2019-12-05 19:08:33
I tried sweeAlert plugin, which works perfectly, but I cant figure out how to do default stuff after confirm. $(document).ready(function () { function handleDelete(e){ e.preventDefault(); swal({ title: "Are you sure?", text: "You will not be able to recover the delaer again!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete!", closeOnConfirm: false }, function (isConfirm) { if (isConfirm) { return true; } }); }; }); and the button <a href="{plink delete! $row->id_dealers}" class="delete" onclick"handleDelete(event);"> </a> //{plink delete

How to add event listener for html buttons in sweetalert dialog box in jquery

纵饮孤独 提交于 2019-12-05 02:30:32
问题 I am using SweetAlert box and I have three buttons, which i created using html inputs but I need to have three different click event listener performing different actions on each button click but its not working. Please help $('#btnProcessRequest').click(function (e) { e.preventDefault(); // var btn = "button"; swal({ title: "HTML <small>Consultation Review</small>!", text: '<button type="' + btn + '" id="btnA" >A</button> ' + '<button type="' + btn + '" id="btnB" >B</button> ' + '<button

How to redirect page after click on Ok button on sweet alert?

给你一囗甜甜゛ 提交于 2019-12-05 00:18:34
I am able to display sweet alert after the page refresh but I have to click on Ok button which I am getting on sweet alert to redirect the page.Please help me in this. <?php echo '<script type="text/javascript">'; echo 'setTimeout(function () { swal("WOW!","Message!","success");'; echo '}, 1000);' echo 'window.location.href = "index.php";'; echo '</script>'; ?> To specify a callback function, you have to use an object as the first argument, and the callback function as the second argument. echo '<script> setTimeout(function() { swal({ title: "Wow!", text: "Message!", type: "success" },

How to use sweetalert2 in angular2

独自空忆成欢 提交于 2019-12-04 09:21:40
问题 Getting this error after npm start in angular project. app/app.component.ts(12,7): error TS2304: Cannot find name 'swal'. app/app.component.ts(21,7): error TS2304: Cannot find name 'swal'. I created an angular project. Inside app.component.ts I added sweet alert code export class AppComponent { deleteRow() { swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33',

Add Sweet Alert popup to button in React component

房东的猫 提交于 2019-12-04 05:59:50
I found this perfect Sweet Alert module for Bootstrap and React (which I'm using in my Meteor app): http://djorg83.github.io/react-bootstrap-sweetalert/ But I don't understand how you include this code inside a React component. When someone clicks the Delete button in my app, I'd like a Sweet Alert prompt to pop up asking for confirmation. Here is my component for the Delete button: import React, {Component} from 'react'; import Goals from '/imports/collections/goals/goals.js' import SweetAlert from 'react-bootstrap-sweetalert'; export default class DeleteGoalButton extends Component {

add sweet alert angular js

断了今生、忘了曾经 提交于 2019-12-04 05:45:49
I'm new to AngularJS and I'm trying to use sweet alert plugin from https://github.com/oitozero/ngSweetAlert , I already added the corresponding scripts to my index.html like this : index.html <link rel="stylesheet" href="bower_components/sweetalert/dist/sweetalert.css"> <script src="bower_components/angular-sweetalert/SweetAlert.min.js"></script> <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script> As the documentacion says. Now in my ctrl.js I have this : var ctrl = function ($scope, SweetAlert) { SweetAlert.swal("Here's a message"); // this does not work } ctrl.$inject

Stop the control while SweetAlert is on screen [duplicate]

人走茶凉 提交于 2019-12-04 04:31:12
问题 This question already has answers here : How do I return the response from an asynchronous call? (36 answers) Closed 3 years ago . I am using sweetalert2 library for showing alert in my code. ConfirmationMessage = function(msg) { swal({ title: "", text: msg, type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Ok", cancelButtonText: "Cancel", closeOnConfirm: false, closeOnCancel: false, allowEscapeKey: true }); } This is the JS function and I am using it

SweetAlert dropdown dynamically add items in list

拜拜、爱过 提交于 2019-12-04 04:21:36
问题 I am currently using sweetalert2 to capture user's input from the dialog. I would like to use the dropdown in chaining queue dialog but I can't seem to find a way to dynamically add items in the dropdown list. Let's say I want to retrieve data from JSON format and place in the dropdown list, is there a way to do it? function userInput() { swal.setDefaults( { showLoaderOnConfirm: true, confirmButtonText: 'Next →', showCancelButton: true, animation: true, progressSteps: ['1', '2', '3'] } ); var

How to add event listener for html buttons in sweetalert dialog box in jquery

独自空忆成欢 提交于 2019-12-03 20:31:43
I am using SweetAlert box and I have three buttons, which i created using html inputs but I need to have three different click event listener performing different actions on each button click but its not working. Please help $('#btnProcessRequest').click(function (e) { e.preventDefault(); // var btn = "button"; swal({ title: "HTML <small>Consultation Review</small>!", text: '<button type="' + btn + '" id="btnA" >A</button> ' + '<button type="' + btn + '" id="btnB" >B</button> ' + '<button type="' + btn + '" id="btnC" >C</button>', html: true }, function (idd) { $("#btnA").click(function () {

More than 2 buttons on sweetalert 2

自作多情 提交于 2019-12-03 06:04:32
问题 I have a sweetalert with 2 buttons but I want to have one more button in it. For example, as of now, I have yes and no I want to add one more button say later. please help $("#close_account").on("click", function(e) { e.preventDefault(); swal({ title: "Are you sure?", text: "You will not be able to open your account!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, close my account!", closeOnConfirm: false }, function(){ window.location.href="