sweetalert

SweetAlert prompt with two input fields

孤街浪徒 提交于 2019-12-21 07:56:04
问题 Currently working on a personal project. I want the user to click a button and a SweetAlert prompt would be presented for the user to verify their credential. However, the code I see on the SweetAlert website only allows one input field. Here is the code I have: swal({ title: "Authenicating for continuation", text: "Test", type: "input", showCancelButton: true, closeOnConfirm: false, animation: "slide-from-top", inputPlaceholder: "Write something" }, function(inputValue) { if (inputValue ===

facing error while using sweet alerts in IE 11

不羁的心 提交于 2019-12-20 06:22:23
问题 i am trying to use sweet alerts in my application its working fine in all browser except IE (version 11).Following errors are coming when i call swal() function. 1.Object doesn't support property or method 'defineProperty'. 2. The value of the property 'swal' is null or undefined, not a Function object first error is coming from sweetalert.min.js and second is coming from my script where i am calling swal function. 来源: https://stackoverflow.com/questions/32070945/facing-error-while-using

sweetalert 2 target a div rather than entire window?

不问归期 提交于 2019-12-20 04:37:02
问题 Is it possible to target a div rather than the entire window for SweetAlert2? If not is is possible to edit the center coordinates? The reason I ask is that I have a few JavaScript games that i would like to use this framework with. these are loaded in <div> 's which are not centered on the page. The sweet alert popup looks strange when it opens as it is miss-aligned. This is fine for mobile games but not for browser based. Any help would be great :) 回答1: Here you go: Swal.fire({ title: 'I

confirm value is not returning from sweet alert service

China☆狼群 提交于 2019-12-19 04:32:11
问题 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,

How to change the background color of bootstrap-sweetalert?

房东的猫 提交于 2019-12-14 03:35:21
问题 What is the best way to change the background color of bootstrap-sweetalert ? this is my code .sweet-alert { background-color: #2f2f2f96; } $(".sweet-alert").css("background-color","#2f2f2f96"); 回答1: update your sweetalert.css with your coding and hard refresh your web browser. It should work. .sweet-alert { background-color: #2f2f2f96; ...other codings... } 来源: https://stackoverflow.com/questions/49365209/how-to-change-the-background-color-of-bootstrap-sweetalert

sweetalert2 inputoptions from file in select example

自古美人都是妖i 提交于 2019-12-13 16:06:01
问题 In Sweetalert2 select example: swal({ title: 'Select Ukraine', input: 'select', inputOptions: { 'SRB': 'Serbia', 'UKR': 'Ukraine', 'HRV': 'Croatia' }, inputPlaceholder: 'Select country', showCancelButton: true, inputValidator: function (value) { return new Promise(function (resolve, reject) { if (value === 'UKR') { resolve() } else { reject('You need to select Ukraine :)') } }) } }).then(function (result) { swal({ type: 'success', html: 'You selected: ' + result }) }) a key value struct is

How to call php function from anchor tag?

喜欢而已 提交于 2019-12-13 00:18:34
问题 I am using a sweetalert popup. I am calling the function from anchor tag but it not taking any action. Would you help me out in this? <link rel="stylesheet" href="assets/css/sweetalert2.min.css"> <script src="assets/scripts/sweetalert2.min.js"></script> <script src="assets/vendor/jquery/jquery.min.js"></script> echo ' <td class="btn-action"><a href="javascript:void(0);" onClick="record_delete('.$p_user_id.')" class="btn-delete"><i class="fa fa-times" aria-hidden="true"></i></a></td>'; <script

Sweet alert closing on spacebar press.

不羁岁月 提交于 2019-12-12 18:18:58
问题 I have a sweet alert with a textarea on it, the window is closing on spacebar press. swal({ title: 'Something Went Wrong', text: '<textarea id="my-textarea" name="my-textarea" rows="5" />', type: 'error', showCancelButton: true, confirmButtonText: 'Yes, Refresh Page', confirmButtonClass: 'btn-danger', html: true } Can I prevent this behaviour ? 回答1: I had the same problem and i solved it like this : If you use le min js, retrieve this part of code in sweet-alert.min.js " =n.keyCode||n.which,a

Using SweetAlert2 to replace “return confirm()” on an ASP.Net Button

左心房为你撑大大i 提交于 2019-12-12 11:32:08
问题 When working in ASP.Net, I often like to have "Are you sure?" popups when clicking things like a delete button. This is easily done like so: <asp:Button runat="server" id="btnDelete" Text="Delete" onClientClick="return confirm('Are you sure?');" onClick="btnDelete_Click" /> I really like the styling and general feel of SweetAlert2's confirm dialog, however they're seemingly a bit more troublesome when I'm attempting to integrate them in a similar fashion. Can someone explain to me how I might

SweetAlert Prompt issue in bootstrap modal

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 04:46:43
问题 I have been trying for more than two days to run SweetAlert prompt in a modal bootstrap without success, the input is not accessible and I don't understand why. I need help please. $("#openSWAL").click(function(){ swal({ title: "An input!", text: "Write something interesting:", type: "input", showCancelButton: true, closeOnConfirm: false, animation: "slide-from-top", inputPlaceholder: "Write something" }, function(inputValue){ if (inputValue === false) return false; if (inputValue === "") {