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
9
votes
1 answer

Highlighting default text input in sweetAlert

I have a SweetAlert2 that allows text input, and I give it a default value. I'd like this default value to be highlighted when the alert pops up, so that the user can immediately overwrite it if needed. Here's an example: And here is the function…
Edmond
  • 615
  • 1
  • 5
  • 15
9
votes
3 answers

Show loading alert with SweetAlert2 without having to interact

Right now I have this code: swal({ title: 'Loading cars from data base', showLoaderOnConfirm: true, preConfirm: () => { return this.carsSvc.getCars().then((cars: ICar[]) => { this.setData(cars); …
user4878548
9
votes
4 answers

How to add textarea tag as input element in sweet alert using jQuery

I don't understand how to add a textarea type in sweet alert. Similar to type: "input" $('#saveBtn).click(function(){ swal({ title: "Enter your Name!", text: "your name:", type: "input", …
Prafull Pol
  • 141
  • 1
  • 2
  • 9
9
votes
4 answers

How to Add Ajax Call with sweet alert

My Ajax method looks like this $.post(url,{ ajax_call:"putDonation", addresse:addresse, phone:phone, email:email, name:name, amount:amount, …
Vikram Anand Bhushan
  • 4,836
  • 15
  • 68
  • 130
9
votes
5 answers

SweetAlert confirm with Ajax request

I'm new at Javascript - coding it actually for the first time. I'm trying to do a button with delete confirmation with SweetAlert. Nothing happens when I press the button with onclick="confirmDelete()". This code may be just crab, but here it…
lingo
  • 1,848
  • 6
  • 28
  • 56
9
votes
1 answer

Launching SweetAlert to prevent user from closing window

I am trying to display a message to the user before he closes the window. I am using SweetAlert (http://tristanedwards.me/sweetalert) which is running fine. The problem is with the JavaScript/jQuery to let me know when the user is trying to close…
leofontes
  • 898
  • 4
  • 16
  • 40
8
votes
2 answers

How to add close button in SweetAlert pop up

I have used the SweetAlert library for displaying a pop up in my application. This is my code swal({ title: "Are you sure?", text: "Test message?", type: "info", showCancelButton: true, focusConfirm: false, …
Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95
8
votes
1 answer

SweetAlert2, .then() - not updating DOM immediately

THE PROBLEM: I want to redirect a user to another page after clicking OK on the sweet alert, but the user is not redirected until I open up another sweet alert for some reason. You can breakpoint over the code, but nothing happens on the…
Sergnio
  • 138
  • 7
8
votes
3 answers

missing select options with Sweet Alert

This may be a ServiceNow issue, but I added a Sweet Alert to show a select box just so I can gather a value to pass on to the next record... but the select box is not showing, the popup is there just no box or options. What am I missing? …
Cheri
  • 81
  • 1
  • 1
  • 2
8
votes
2 answers

Add Sweet Alert popup to button in React component

I found this perfect Sweet Alert module for Bootstrap and React (which I'm using in my Meteor app): http://djorg83.github.io/react-bootstrap-sweetalert/ But I don't understand how you include this code inside a React component. When someone clicks…
8
votes
2 answers

Sweet alert dialog with spinner in AngularJs

I am trying to display a spinner in a sweet alert dialog something close to Bootstrap modal dialog (http://jsfiddle.net/D6rD6/5/) The closest i could come up with is something like this : SweetAlert.swal({ title: 'Import errors occurred…
hakuna
  • 6,243
  • 10
  • 52
  • 77
8
votes
6 answers

Rails 4: How to get sweet alert confirm work?

I'm a beginner with rails and I want to use Sweet Alert to replace the basic ugly confirm messages on deleting records. I've added sweet-alert gem and sweet-alert-confirm to my gem file I've done exactly what they said in the their Read Me, but It…
Moataz Zaitoun
  • 729
  • 1
  • 7
  • 18
8
votes
8 answers

How To Use Sweet alert

This Is My HTML Code I Have Two Input Button That I Want To Show Sweet Alert When a user Clicks on any Button 1 adminMohammad Farzin
Mohammad
  • 247
  • 1
  • 3
  • 14
7
votes
4 answers

SweetAlert2: Set dialog height

for sweetAlert2 I noticed there's no "height" property but there is a "width" property, is there a way to set the height of the dialog to be 80%? Thanks https://limonte.github.io/sweetalert2/
Eric Bergman
  • 1,453
  • 11
  • 46
  • 84
7
votes
3 answers

How to use localize.js translation cross js files. e.g SweetAlert2.js

I want to use the jquery.localize.js (i18n json files) in another js file. Lets say sweetalerts2. The localize provides translations in json files, according to the language you choose(EN,FR,GR).(https://github.com/coderifous/jquery-localize) The…
1 2
3
71 72