Questions tagged [sweetalert]

SweetAlert is a JavaScript library that provides a replacement for standard alert() dialogue.

SweetAlert is a JavaScript library that provides a replacement for the standard alert() dialogue that allows styling and customization. Indeed, it also may be regarded as a replacement for confirm() and prompt().


Documentation :

Similar Libraries:

1069 questions
7
votes
5 answers

Using Sweet alert with Typescript class

I have a method inside a typescript class that just looks like this var confirmation = confirm("Run Agent Job?"); if (confirmation) { console.log('yes'); } else { console.log('no'); } I'm trying to convert this to…
user3325783
7
votes
2 answers

SweetAlert2 add dynamic options to select input

I want to add dynamic options to a SweetAlert2 input type select that looks like this: swal({ title: 'Select Ukraine', input: 'select', inputOptions: { 'SRB': 'Serbia', 'UKR': 'Ukraine', 'HRV': 'Croatia' }, inputPlaceholder: 'Select…
Andrei Zamfir
  • 143
  • 1
  • 3
  • 11
7
votes
4 answers

add sweet alert angular js

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
Luis Felipe Garcia
  • 148
  • 1
  • 3
  • 11
7
votes
2 answers

How to add HTML input into sweet alert?

I am trying to add radio button into dialog box using sweet alert but I'm not able to do it. Following is the code: swal({ title: "Please select an reason to cancel this job !", type: "warning", text:"
b22
  • 293
  • 5
  • 10
  • 22
6
votes
5 answers

Sweet Alert 2 - Link in "confirmButtonText" button

I would like to know how I could put a link in the button that generates the confirmButtonText of Sweet Alert 2. The goal is that when you press that button redirects to a page that removes a record from a database, until now I had it with a simple…
tmrr
  • 73
  • 1
  • 1
  • 6
6
votes
3 answers

Sweet Alert Delete Confirmation with a href

Im using PHP, and Sweet alert for a delete confirmation. Problem is that it is deleting before showing the sweet alert. This is my HTML(which is using PHP in it).
James
  • 63
  • 1
  • 1
  • 3
6
votes
4 answers

SweetAlert2 : Validation required for one of the fields

I am trying to perform validation on one of the fields in the form. Only if the value for that field exists will I be able to invoke the API, if not an error message will be thrown. I tried various examples from SweetAlert2's website. I just want…
Ice_Queen
  • 319
  • 2
  • 5
  • 19
6
votes
1 answer

How can I enable Confirm Button on input in sweet alert 2

I need to disable the confirm button when the user hasn't changed any value in the text box inside the sweet alert and enable it only when the value in the text box has changed but I can't seem to find a way for this. here's my code: swal({ …
Zeeshan Adil
  • 1,937
  • 5
  • 23
  • 42
6
votes
2 answers

Pass HTML code as text of sweet alert

I am using this in my application. I would like to use sweet alert like below. swal({ title: "Are you sure?", text: "You are going to delete "+ name +" address. ", icon: "warning", buttons: true, dangerMode: true, …
abu abu
  • 6,599
  • 19
  • 74
  • 131
6
votes
3 answers

How can I show an image in sweet alert that I want to upload?

I have the following code not working. I want the image to appear in a swal (Sweet Alert) when the input is changed, but I don't know what's not working. I get the following error on console: Failed to execute'readAsDataURL' on 'FileReader':…
I_like_trains
  • 236
  • 1
  • 4
  • 16
6
votes
3 answers

Sweet Alert - Ajax call without confirm button

How can you use sweetalert to do an Ajax call without a confirm button but still show a loading gif? Basically I want a loading gif to display while the Ajax call is running. The out-of-the-box solution requires you to enable the confirm button…
adam78
  • 9,668
  • 24
  • 96
  • 207
6
votes
2 answers

SweetAlert confirmation dialog with asp.net listview delete?

Please help me fathom this. I have created a ListView, displaying data from a SQL database. I have enabled inserting, editing and deleting and it all works. What do I want? I want to use SweetAlert to prompt the user to confirm yes/no whether they…
Raker
  • 344
  • 2
  • 6
  • 15
6
votes
3 answers

Sweet Alert with form JS (3 input)

I would like to implement a form inside of the sweet alert. I can put just one input inside, with title and body. There is a way to customize the alert, docs says it, but is not allowed to load class css3 from my framework (customizecss.com) or from…
Alejandro Lora
  • 7,203
  • 3
  • 18
  • 34
5
votes
1 answer

Is it possible to add an entire angular component inside sweet alert 2?

I wanted to know if there is a way to make an angular component open up in a sweet alert box, for example Swal.fire( { HTML: '', }) what I intended was to use the component selector instead of…
5
votes
2 answers

Django sweetify

I already read the documentation about https://github.com/Atrox/sweetify-django but I don't understand clearly, I already download and import requirement of sweetify in Django. I just want that if the record is updated the popup message (sweetify)…
user12951147