Questions tagged [sweetalert2]

A responsive, customizable, accessible (WAI-ARIA) replacement for JavaScript's popup boxes with zero dependencies. Use this tag for questions that involve using this library.

A JavaScript library for generating popup windows. It can be combined with jQuery and it returns promises.

SweetAlert2 page

SweetAlert2 CDN


Stack Overflow Quick Start Snippet

html

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9.17.1/dist/sweetalert2.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@9.17.1/dist/sweetalert2.css">

javascript

Swal.fire({
  title: 'Success!',
  text: 'Swal ready',
  icon: 'success',
  confirmButtonText: 'Cool'
})
821 questions
0
votes
0 answers

Sweetalert2 confirmbutton and paypal

I am trying to make the confirm button of sweetalert2 a "buy it now" paypal button (generated from my paypal account), is this possible? The form looks like this:
lithos
  • 1
  • 3
0
votes
2 answers

Loop in Script not working

I'm trying to redirect a user after a onclick action but the userid in the following code always remains the same regarless the user chosen in the table. Maybe I'm missing something here...
jmouk
  • 21
  • 5
0
votes
1 answer

Uploading image with DropZone and other values via AJAX but calling SweetAlert when Submit Data

I have a form with some fields (first name, last name and profile picture) that looks like this:
Fabian
  • 541
  • 9
  • 30
0
votes
0 answers

sweet alert and value from radio

I have a problem with getting value from a radio from a sweet alert. I want to give value from a radio to my HTML page. addTags is a button, radioV is from

in html. Any ideas? $scope.addToTags = function() { var…
Djn
  • 9
  • 3
0
votes
1 answer

How to continue to submit a form after preventing it with jQuery?

How to continue to submit a form after preventing it with jQuery? For Example: There is a deleting input element: {{ method_field('DELETE') }} {{ csrf_field() }}
zwl1619
  • 4,002
  • 14
  • 54
  • 110
0
votes
2 answers

SweetAlert2 Confirmation on form submit not working with Codeigniter

I'm trying to make a confirmation popup before user submits the form with CodeIgniter but the trigger/submit part is not working. It asks for confirmation but doesn't submits the form. My HTML:
CodeWriter
  • 107
  • 1
  • 1
  • 13
0
votes
0 answers

What is the difference between SweetAlert and JS prompt box

in simple javascript code the input of the prompt box work properly f = prompt ("write a number here") r = 1; x = f-r; alert(x); when style the prompt box with sweetalert the result will be NaN before you write the input value f =…
0
votes
0 answers

Sweetalert2 ajax request and validate HTML form?

I'm using Sweetalert2 to confirm and update some data. The style of the sweetalert combine with bootstrap v4 (alpha). The multiple form input is generated with HTML like this example. After getting input data, an ajax call is made to update it.…
totoprayogo1916
  • 160
  • 4
  • 20
0
votes
2 answers

How to add timer after sweetalert2 open?

I want to add timer after callback another function in Sweetalert2. In the example just add timer when swal run. this is basic code : swal({ title: 'alert!', text: 'I need this close after my function', }) and below is ajax and I need the swal…
totoprayogo1916
  • 160
  • 4
  • 20
0
votes
1 answer

Sweetalert2 and Qunit.js

Could anyone give me a pointer on how I test the following code in QUnit? function ChooseBranch() { var BranchPromise = getBranches(); BranchPromise.then(function (BranchData) { var BranchOptions = []; $.each(BranchData, function (i, d) { …
dave
  • 1,410
  • 1
  • 16
  • 42
0
votes
1 answer

How to make the confirmation box return true for javascript sweetalert2

I want to change my alert box to Sweet Alert2 (https://sweetalert2.github.io/). After clicking the "Ok" button on the Confirm alert window, nothing seems to be happening. I can't seem to figure out what's wrong or how to solve the problem. my codes…
K.Jue
  • 31
  • 1
  • 2
  • 8
0
votes
1 answer

Sweetalert 2 placeholder opacity

I've created a form with sweetalert2 but the placeholder is barely visible. I've looked at this post about sweetalert placeholder styling. But this is for sweetalert. I've looked at my code if perhaps the same worked for 2. I've found this code in…
JJDodo
  • 1
  • 1
  • 1
0
votes
1 answer

Error when use jQuery sweetalert2

This is my code before add sweetalert2 to delete posts: if (action == "delete") { this.model.destroy({ beforeSend: function() { target.addClass('loading'); …
user7336361
-1
votes
1 answer

I can't install sweetalert2 in Angular

enter image description here This issue. Can you help me ? I tried other installation instructions. I tried them all but couldn't find the solution. enter image description here
Nexi
  • 1
  • 1
-1
votes
1 answer

How to change the background (HTML) when a SweetAlert2 is active

I think this is a basic question for the SweetAlert2 active users, so, here we go: I have a SweetAlert2 ultra basic like this: What I want to do is to change the background (of the HTML) when the SweetAlert2 is active, and when the SweetAlert2 is…
emiliorivas16
  • 119
  • 1
  • 7