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
5
votes
3 answers

How Can I Install sweetalert2 via Laravel-Mix?

STEP1: In console/terminal. npm install --save sweetalert2 STEP2: In app.scss add this line... @import '~sweetalert2/src/sweetalert2.scss'; STEP3: In app.js add this line... const swal = require('sweetalert2'); STEP4: In…
Areza
  • 671
  • 14
  • 26
5
votes
2 answers

SweetAlert2 scrolls to initiating element after close

After closing of the modal I force the browser to scroll to the top of the page to see any error messages. After integrating the SweetAlert2 module to confirm submission the application will auto scroll back down to the submit button now after…
Raymond Holguin
  • 1,050
  • 2
  • 12
  • 35
5
votes
6 answers

Input in sweetalert 2 not typeable or cannot be typed on in materializecss modal

I have modal in which when i click add bills button it will popup the sweetalert2, the code provided below came from their documentation, so i think there is no problem with the codes, anyways, my problem is that the input cannot by type-able and it…
5
votes
2 answers

Sweetalert2 Ajax - post input data

I have recently been working with SweetAlert2 on my project, and I would like to put together a "Add Note" feature. User clicks on a button, gets directed to a page, and the following executes.