sweetalert2

sweetalert2 text input with validation of the text with javascript in R Shiny

痴心易碎 提交于 2019-12-13 20:22:22
问题 I am upgrading from sweetalert to sweetalert2 in R shiny and so far have managed to get the regular response by the R shiny server to ok/cancel buttons in the alert messages working, but now I am stuck with the next type, namely text input messages where I used to perform some validations for: empty use of special characters before sending the value to R. Here you can find an app in which sweetalert2 is implemented. in the new problem I'm trying to replace the javascript in that app with a

Observe sweetalert2 confirm with javascript in R Shiny

冷暖自知 提交于 2019-12-13 20:09:15
问题 I have switched to sweetalert2 since the old version is more limited than the new version which is actively developped. I am running into a problem however, the code I used to observe confirm or cancel in the old version is not working for me anymore. In the old version I used to add a function in the ' myjava ' code after closeOnConfirm: true} namely: , evalFunction = function(isConfirm){ if (isConfirm === true) { var val1= 1; Shiny.onInputChange('option1', [val1, Math.random()]); } else {

Including a different image in SweetAlert2 popup message based on selection of a div after clicking a button

陌路散爱 提交于 2019-12-13 18:51:39
问题 I think something similar to this question was answered in the past. However, I read a number of StackOverflow posts and still couldn't solve the issue. Probably, that is because I don't have a good understanding of jQuery yet and can't apply basic concepts to what I need to solve. So, I would greatly appreciate if you could help me solve this issue. Thanks! Right now, what happens is the following: 1. When clicking a button in the middle, five circles show up. 2. When you click a circle, a

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

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

How to make Sweet alert auto close after ajax complete?

若如初见. 提交于 2019-12-11 22:03:24
问题 I'm using sweet alert, but i want make it close automatically if the request of ajax is completed swal({ title: "Are you sure?", text: "You are choosing order by custom search", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Confirm", closeOnConfirm: false, timer: **AUTO WITH AJAX??** }, I am adding a variable var dones = $(document).ajaxComplete(function(){ swal.close() }); and make swal like this swal({ title: "Are you sure?", text: "You are

How do I use File Handlers in Sweetalert?

…衆ロ難τιáo~ 提交于 2019-12-11 14:04:52
问题 I am very new to JavaScript so I am guessing, that this problem will be fairly simple for most of you guys (or at least I hope so...) I have this SweetAlert Code. It asks the User to upload two images and one text. I am able to add the text to my database but I am struggling with the images... I know that I need to pass the Images using the File Handlers, but I don't know how... This is my Server that I run my Code on: https://mars.iuk.hdm-stuttgart.de/~mk304/Web_Projekt/webpage/ui/sweetalert

How to show SweetAlert in JavaScript

邮差的信 提交于 2019-12-11 04:26:01
问题 How can I show SweetAlert in this JavaScript code? function removeReg(del_reg) { if (confirm("Are you sure you want to delete? \n the reg name : " + del_reg)) { // Code goes here } } I just want to call SweetAlert in the if condition, i.e. in SweetAlert, I need to show the message "Are you sure you want to delete?" . 回答1: Call swal() with your custom options in the removeReg(del_reg) function and use the Promise returned by swal() to determine what is the user's choice: If the user clicked

How to listen for when sweet alert closes

一世执手 提交于 2019-12-10 18:40:06
问题 I am currently working with sweetalert2 and I am trying to detect when the alert closes. However the DeleteUnsavedImages function is not firing. I thought that assigning the function to the onclose key would work but no luck. swal({ html: data, showCloseButton: false, showCancelButton: false, width: 800, showConfirmButton: false, onClose: DeleteUnsavedImages() }).then(function () { }); function DeleteUnsavedImages(){ var test = "-1"; } Any help would be appreciated :-) 回答1: I tested with my

Sweet Alert 2 Open in Parent Frame

北慕城南 提交于 2019-12-09 20:38:02
问题 I have an iframe with a source that is a php file. What I'm trying to do is get Sweet Alert 2 to open in the parent frame rather than inside of the iframe. I have tried changing the target and have not had any success. None of the following target options have worked: swal({ target: 'window' target: 'document' target: 'parent' }); This is the result that I get when 'body' is the target: Edit: SweetAlert 2 code swal({ type: 'error', text: 'You did not select any files.', target: 'top' });