Questions tagged [sweetalert]
SweetAlert is a JavaScript library that provides a replacement for standard alert() dialogue.
1,066
questions
0
votes
3
answers
58
views
i have a form with 2 buttons for submitting two different form action and form method
I have two buttons:
one submitting the form for changing the photo and
one deleting.
By deleting i want to send delete method to the route delete with sweet alert.
However this does not work.
How ...
0
votes
0
answers
22
views
How to render a react component in sweetalert2 innerhtml?
This is my code which i want render CarReport component in a sweetalert modal. <CarReport /> is just a simple form.
Swal.fire({
title: "..."
html: <CarReport />, /...
0
votes
0
answers
7
views
Sweetalert shows half of the icon
I am using sweetalerts to send some kind of feedback to the users but for some reason when the popup appears the icon animates just half of it.
Does anyone know any reason why this would happen? I ...
0
votes
0
answers
8
views
this sweet alert i want to save data to my localhost but its not save and always looking for url: rootURL + "api/v1/case/add",
function submitCreateCaseForm($formStatus) {
Swal.fire({
title: "Do you want to save the changes?",
showDenyButton: true,
showCancelButton: true,
...
0
votes
0
answers
104
views
Swal is not defined using laravel livewire component
I am using laravel livewire component and I want to provide feedback to users with sweetalerts (realrashid/sweet-alert) using Swal.
I am getting this issue in console:
Swal is not defined
This is my ...
0
votes
0
answers
24
views
sweetalert pop ups every page loaded when flash message not set in php 8.0
I switched to php 8.0 because I had error unexpected character in input: ' filename lib/rules.php, but in php 8.0 I face another problem that sweetalert always pop ups in every pages that loaded ...
0
votes
1
answer
16
views
swal callback is not firing up properly
i have a code where i am trying to call aweetalert, note it is using sweetalert, not sweetAlert2.
So here is the code
JS Code
function showMessage() {
swal({
title: "",
html: '...
0
votes
0
answers
90
views
ReferenceError: Swal is not defined
i got admins table in my working project that is developed in laravel 8
the admins table has delete option and other options as well
i use sweet alert to confirm deleting
i use
<script src="...
0
votes
0
answers
18
views
I am Getting java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
My android app crashes when i try to logic in on press of the login button. I have tried to catch/handle the error but its still same result
I have tried but failed to catch the error so the app ...
0
votes
1
answer
110
views
How can we disable sweetalert select box option.?
I used sweetalert in my jquery web application. And I'm showing that with select box. That's sweetalert options like below.
swal({
title: 'Select field validation',
input: 'select',
inputOptions:...
0
votes
0
answers
17
views
Multiple Contents in SweetAlert
I am wondering if there is a way to put multiple content: "input", lines inside SweetAlert.
I will need a way to assign each of these input boxes a name in the .then statement.
I am using ...
0
votes
0
answers
46
views
SweetAlert Variables
I want to be able to include a SweetAlert variable in both the title and the text of a SweetAlert.
I have the following code:
swal({
title: "Log In",
text: "Log In to ...
0
votes
0
answers
40
views
Laravel : How to make Sweetalert close when data have been loaded in data base?
i run upload data in my project, i want sweetalert close when the data have been loaded in data base. this is my sweetalert code:
document.getElementById('subImport').click();
$(document)....
1
vote
0
answers
43
views
My php jquery ajax form request sometimes fire twice, maybe 2 out of 10 request
Below is my code to submit the form.
8 out of 10 request sent works fine, while the others fires twice or thrice and yet return a single response for sweet alert display.
I make use of sweet alert ...
0
votes
0
answers
34
views
how to show else condition messages in sweetalert error popup using ajax?
I'm scratching my head for a couple of days now and I can't get SweetAlert2 popup in my else condition as a error using ajax. i m tring to get a error if my if condition does not true.
Here is my JS ...
0
votes
0
answers
234
views
Sweet Alert message problem, It is not appearing on form submission
I was trying to display a pop up message using sweet alert function after successful form data submission. My data is getting inserted into database but after successful insertion message including ...
0
votes
1
answer
83
views
sweetalert does'nt work when clicking on button [closed]
Good day, I am trying to use sweetalert onclick but when I click on the button nothing happens, only the alert is displayed when refreshing the page, what I want to achieve is that when clicking on ...
0
votes
1
answer
537
views
how can I resolve this warning: SweetAlert2: Unknown parameter "onOpen"?
my sweet alert show this warning, how can I resolve this? any idea
don't know what causes this warning when I fire this Sweet Alert, it shows this warning.
here is the alert component code:
...
0
votes
0
answers
35
views
Sweet alert message after from submission is not working
I am trying to display an alert message after the record is inserted in the datbase and normal js alert is working fine and displaying the message.
echo '<script>';
echo 'alert(" Your ...
3
votes
3
answers
777
views
sweet alert function not displaying the message
I am trying to display an alert message after the record is inserted in the datbase and normal js alert is working fine the code for this is
echo '<script>';
echo 'alert(" Your request has ...
0
votes
0
answers
75
views
SweetAlert is displaying UTF-8 characters wrong
I am using sweetalert2 in a project, I am displaying Arabic text on the pop up. However, the text shown is not being encoded correctly. I have already added the meta tag to the head of the website, ...
0
votes
1
answer
141
views
Getting Urlsessiontask failed with error: the request timed out with blank screen RxSwift in swift
I am using RxSwift in swift. When my server is close it shows below error with blank screen. I have used a alert. But I have to click too many time to close the alert here is the error
I have ...
0
votes
0
answers
98
views
@sweetalert2 How to handle the error message in confirm if the network server is down on sweetalert2?
how do you handle error messages in confirm if the network is down on sweetalert2?
i did it like the following code, please provide the solution
const handleDownload = () => {
setAnchorEl(null);...
0
votes
1
answer
40
views
How to add quotes in Swal text without being replaced with "?
const sc = {...swalConfig.confirm}; sc.text = "{{ __('Taking the records from the table \"USERS\" to the "ROLES" table, without any additional action.') }}";
I have this ...
0
votes
0
answers
24
views
Deleting with javascript sweet alert [duplicate]
I want to delete a record with PHP, if want to have confirmation yes and no, after clicking yes I want to show another message that the operation was successfully done. But my code doesn;t delete the ...
0
votes
1
answer
317
views
sweetalert2 - How to show loading animation icon
I am using sweetalert2 for the alert message. Here is my code:
this.$swal({
icon: 'warning',
html: 'Please be patient, it can take up to several minutes to generate a ...
0
votes
1
answer
634
views
Laravel 9 Delete Confirmation with SweetAlert not working
I am trying to delete data from resource controller with sweetalert in laravel 9. However, it is not working.
blade.php
<a href="{{ route('employee.destroy', $item->id) }}" onclick=&...
0
votes
0
answers
33
views
How to skip a field when its value is null with SweetAlert?
I am using the sweetAlert library, I have a Dropdown where it shows a list of elements associated to the ID #references, it happens that this Dropdown is not a mandatory field, it may or may not be ...
0
votes
0
answers
64
views
how can I resolve sweetalert background distortion?
enter image description here
Upper image is the Sign-in page.
I added sweetalert, and it goes wrong like below.
(the alert set in the middel, and my sign-in form goes up! It should be located in the ...
0
votes
1
answer
106
views
How to loop Sweetalert delete confirm into laravel foreach?
Into Laravel child blade file, I loop foreach users and then use sweetalert to delete into foreach loop.But this sweetalert is working only top row. This is example code just like my code.
<tbody&...
0
votes
1
answer
258
views
How to show a message in Sweet Alert after the execution of a submit button in MVC.Net?
I am working inside an MVC.Net project. Where within my view I have two submit type buttons, where I do different actions on both.
What I want is to implement an alert that notifies me when it has ...
0
votes
0
answers
105
views
How do I add a cookie after clicking the confirm button for sweet alert?
I'm currently learning Js and I can't get my code to add a cookie to my browser when clicking the "Okay!" button on my sweet alert.
for(var i = 0; i < objPeople.length; i++) {
// ...
0
votes
1
answer
59
views
Sweetalert getting closed automatically
I'm using sweet alert in my project but it's getting closed within seconds
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
...
0
votes
0
answers
107
views
Uncaught (in promise) SweetAlert: 2nd argument ('undefined') is invalid
I'm trying to create a login/logout with React and Sweet Alert, but the it keeps saying that the 2nd argument is invalid and I'm not sure where.
Below the code for the login.
Can anyone spot any error ...
0
votes
0
answers
76
views
Why the Script component inside the Head component of a Nextjs application blocks the dynamic insertion of css rules by the sweetalert library?
Below snippet is taken from _app.tsx file. I know that having Script component inside the Head component is wrong but this buggy code is blocking the sweetalert library (which I am using in another ...
0
votes
0
answers
56
views
Javascript sweet alert
how write a code alert succes use "sweet alert" on login form , example my code
if($jum > 0){
$hasil = $row -> fetch();
$_SESSION['admin'] = $hasil;
...
0
votes
1
answer
113
views
Does Sweetalert work in Google Tag Manager?
I have been copying and pasting code from Sweetalert into Google Tag Manager. It doesn't appear at preview and after submit onto website it doesn't apper. Does Sweetlart works in Google Tag Manager?
(...
0
votes
0
answers
143
views
Browser tab close/refresh alert in angular
I want to patch an API that fetches the date and time from users activity of browser tab close or refresh event. In my API request body, I am passing eventIDs. So, for an example, eventID 1 for tab ...
1
vote
0
answers
147
views
How to edit css files of SweetAlert 2
Hello I am using sweetalert 2 to show some alerts to a project.
It supposed to look like this
but it does like this
And it because of this style. The style is set to auto. When i uncheck the css ...
0
votes
1
answer
53
views
form didn't submit after I click the confirm button of sweetalert
What's wrong with my code? sweetalert is working and it will pop up if i click the button in my form but when I click the confirm button in sweetalert the form did't submit in other words nothing ...
0
votes
0
answers
28
views
The API is call is not happening . I'm trying to get send values to JAVA from JavaScript. I'm getting Uncaught Reference Error
`
function errordescp(dataofexception,process_id,error_id,process_type){
swal.fire({
"title": `<h3>`+ '<strong>' + "DESCRIPTION" + '</strong>'+ `</...
0
votes
0
answers
24
views
sweetalert retrieve value from select input html [duplicate]
I created a sweetalert popup with html inside and select options.
I cannot find a way to detect and assign the value of the selected option
this is my code:
Swal.fire({
title: 'test title',
...
0
votes
0
answers
267
views
How to expand Tom Select options over SweetAlert2 container
I am using SweetAlert2 to display popup messages and capture information dynamically, for multiple choice fields with single response I have chosen Tom Select which allows me to type to filter.
...
-2
votes
1
answer
79
views
How to submit in swal?
I have this sweetalert triggered on the submit of a form.
<script src="{{ asset('themes/js/sweetalert.min.js') }}"></script>
<script>
$('.btn-danger').click(function(...
-1
votes
1
answer
655
views
How to add pop-up modal or sweet alert in return controller?
I want to pop up a pop-up or sweet alert when clicking the delete button to confirm the delete. I'm using Laravel 9 and Tailwind CSS. Here is my code:
public function index()
{
if (request()->...
0
votes
0
answers
27
views
How to get an input value to a variable in SweetAlert2?
I'm making an e-commerce of alcoholic beverages, I want to show an alert when you first enter the app asking for your age, then get that value to set a boolean to let you buy or not alcohol, but I ...
0
votes
1
answer
270
views
sweetalert2 ajax send otp code and get json response php
I want to send the otp code in ajax form with sweetalert2. Everything is fine and ajax is sent and the response is received. But the response it receives is json and I cannot process and display it in ...
0
votes
1
answer
364
views
Remove sweet alert div (which is hidden) after swal.fire function called in vue 3
I am using VueSweetalert2 with Vue 3 and Vuex 4. when i call sweet alert function like this
this.$swal.fire({
text: 'Success',
icon:'success',
})
sweet alert append one div everytime with ...
0
votes
1
answer
54
views
i need help on using post in asp.net mvc swet allert
I post the data in the first screenshot. And I'm warning you to wait on the button. In the second picture, I print on the screen that the registration has been completed successfully.
But I cannot ...
0
votes
0
answers
81
views
Sweetlaert2 adds to body pointer-events: none
Project on Vue 3 composition. Installed npm i sweetalert2 module
import Swal from 'sweetalert2';
export default function () {
const ERR_HANDLER = (e: any) => {
const { message } = e.response....