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.
746
questions
0
votes
1
answer
19
views
Restrict Sweet Alert input characters Length in Angular
Requirement : The user should not able to type more than 20 characters within the input box.
I have implemented Sweet alert for displaying messages in my Angular project.
Once we click on a button a ...
0
votes
1
answer
21
views
How to call Sweet Alert 2 confirmation on PHP echo link?
I need help, please.
As part of the table, I have echo a link to a controller for the next phase, but I want a Sweet Alert 2 confirmation before the controller is executed. I am new to PHP so I always ...
0
votes
0
answers
18
views
Display SweetAlert fullscreen
We're looking to display a SweetAlert popup in fullscreen.
Here's what we tried so far:
CSS
.fullscreen-swal{
z-index: 9999 !important;
width:100vw !important;
height:100vh !...
0
votes
0
answers
11
views
Using SweetAlert themes
Good afternoon,
We're looking to use the themes, but we can't figure out how to do so - we're not very experienced developers.
We understand that we need to import the corresponding CSS file for the ...
0
votes
0
answers
27
views
Sweetalert 2 - Post Variable from form AND Sweetalert to PHP?
I have the following code. I need the variable "$computerID" from the form and the variable "hardwareComputerName". I tested some things, but nothing worked. The variable "$...
0
votes
0
answers
23
views
What is the replacement of alert() helper function in Sweetalert v2
I'm using Sweetalert v2 with Laravel and because I had experience with Sweetalert v1, I knew that in the Controller method, I can do something like this:
public function update(Request $request, User $...
1
vote
2
answers
37
views
How to show a custom variable from Laravel into Sweet Alert message
I'm working with Laravel v8 and Sweet Alert v2 and I wanted to show a popup message when the user clicks on the Delete button.
So I coded this:
$(document).on('click', '#btn-submit', function(e) {
...
0
votes
0
answers
27
views
Uncaught ReferenceError: swal : Sweetalert2 with laravel project is not working
I am using sweetalert 2 with laravel project, it works fine when I am using CDN link, but it does not work after installation through npm install --save sweetalert2 and gives the following error.
...
0
votes
0
answers
19
views
Onclick event inside a PopUp
The objective is to click on the check, the Sweetalert2 window should be closed and the information will be reflected in the inputs... currently, if I click on the "Accept" button, it is ...
0
votes
2
answers
43
views
Cancel function execution with SweetAlert
I have buttons to execute scripts in my Sheets Addon
<button class="button-68" role="button" onclick="morphf3994()">Unir columnas con el mismo encabezado</button&...
0
votes
2
answers
33
views
Sweetalert Loading Screen Before .withsuccesshandler
i'm integrating sweetalert2 in my Google Workspace Addon. The code is simple.
Functions for sucess and error.
<script>
function swalsuccess() {
Swal.fire({
title: '¡Hecho!',
text: 'El ...
0
votes
0
answers
22
views
Modal don't show after reload
I have a modal which is called by SweetAlert2 library, the problem is that it works fine on the first call, but after reloading the page, it is no longer called. The variable ageVerification only ...
2
votes
2
answers
43
views
Can you instantiate another `BrowserRouter` inside a `BrowserRouter` based App?
Background: I am trying to use sweetalert2-react-content to let me put a react <Link> inside a Sweetalert2 footer.
Generally speaking sweetalert2-react-content is supposed to let you place react ...
0
votes
0
answers
25
views
Wait for Sweet Alert input if a condition is met, otherwise continue
I have this script, which in some cases may require user input. It works, but the script continues regardless of the result of the Sweet Alert input.
$('#cart').on('click', '.button', function() {
...
0
votes
0
answers
21
views
why the Ip is showing in sweetalert2
when i run this it only shows me the loader and does not get the ip.
i did different modification but nothing seems working... and also i am very new to javascript.
const getIp = document....
0
votes
0
answers
14
views
How to resubmit a form with a prevented multi-button using Sweetalert2
I have a table where I retrieve some data from the database and list them, and a form within the table. There are some buttons in this form. Like Cancel.
After clicking the cancel button, I take the ...
0
votes
0
answers
35
views
using cropper.js after PHP upload doesn't work
I'm a learning student who is making a picture upload feature with HTML, CSS, JS, and PHP.
My final goal is to make a profile picture upload feature with cropping.
I found cropper.js would be a good ...
1
vote
1
answer
25
views
Loading scripts after SweetAlert2 modal has loaded
I'm using the ShareThis share button generator, which renders social media share buttons by looking for a class sharethis-inline-share-buttons. The problem is that I need to render the share buttons ...
-1
votes
0
answers
10
views
I need create a code/program to click in this button automatically when it appears randomly
export function chamadaAleatoria(v) {
return new Promise((resolve, reject) => {
let timerInterval
Swal.fire({
title: 'CHAMADA ALEATORIA',
html: '' + usernameAI + 'Clique em OK para confirmar sua ...
0
votes
0
answers
26
views
How i can use a node package in my project with npm command not CDN?
I installed sweetalert2 by npm install sweetalert2.
How i can use it in html file. Below code does not work for me.
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
&...
-1
votes
2
answers
41
views
Modify success message when the form is delivered
I really want to have a better aspect in the "deivered" page of my form. Is it possible to use "SWEETALERT2"??
This is my form code in html:
<form class="form-2" id=&...
-1
votes
0
answers
18
views
How to convert sweetAlert2 popup content into pdf and download in Angular?
I am Using Sweetalert2 for my Popup window In Angular.
I have download button inside popup window, once i click that download button, poppup content should convert into PDF format and it able to ...
0
votes
0
answers
14
views
Sweetalert2 problem with bootstrap modal and jquery 3.6
sweetalert2 confirm button not clickable (missing focus) when bootstrap modal is open. Please help. I found no solution to this problem on the Internet. Thank you
0
votes
0
answers
27
views
how to have 2 swal templates open
is it possible to have two swal templates from sweeter alerts open at the same time?
picture this:
I am developing a blog and the page's creation is made on a swal template which inputs have a ...
0
votes
1
answer
44
views
Laravel show validation errors with SweetAlert
I am want to use SweetAlert to show the validation errors
In success case I am returning the success message successfully
Controller
return redirect(route('home'))->withSuccessMessage('Your Message ...
0
votes
0
answers
14
views
Sweetalert2 only works with first button in foreach [duplicate]
The following code shows a popup delete confirmation for different files in a gallery and on confirm it loads delete.php file to initiate deletion.
Everything works, but only the first button in a ...
1
vote
1
answer
73
views
Laravel realrashid/sweetalert not working
I am trying to install SweetAlert in my Laravel project so I ran this commands
composer require realrashid/sweet-alert
php artisan sweetalert:publish
And inside my controller I made this
public ...
0
votes
1
answer
26
views
How to send custom value to sweetalert javascript code from PHP?
I want to warn user on attempting to delete a file. how can I transfer some details via the html button to this javascript ? for example, each time the user will be deleting different files, so the ...
0
votes
1
answer
116
views
Add sweet alert 2 to nuxt3 project
I'm struggling to integrate sweet alert 2 as a plugin into a nuxt3 app. I'm trying to use vue-sweetalert2 but I at some point it define global variables.
// Inside the install function
vue.prototype.$...
0
votes
1
answer
22
views
Sweetalert 2 i cant make this library work
Here is the problem. Sorry for stupid question.
I read how to connect this library to my project.
I use vs-code. First, i need to install npm in my project with command npm install sweetalert2 in ...
0
votes
1
answer
27
views
How to change aspnetboilerplate "an error occured dialog"
I want to change aspnetboilerplate sweetalert to any custom error dialog. I am using ASP.net core with Angular. Whenever there is a exception at server side, this dialog pops up. I can't find the ...
0
votes
0
answers
31
views
How can I change the font size of a Swal2 Toast element title
I have been working on a project for some time, and researched one specific problem I have been unable to fix: changing the font size of a Swal2 Toast title. Everything functional works, but all the ...
0
votes
0
answers
48
views
Sweetalert2 insert php
I have this code and I have the following error when I implement .js with sweetalert2 with the error messages it does not insert the post in the database, so how much do I remove the .js from the code ...
0
votes
0
answers
23
views
jqueryvalidation + sweetalert2 + wpcf7 (WordPress)
MODAL: Wait for processing
modal example
Hi guys, I have an email form on a WordPress site that works normally by validating the fields and showing an error or success message (sweetalert2).
What I ...
0
votes
0
answers
26
views
How to import css file for SweetAlert2?
I have a lot of css custom for sweetalert so I clone a sweetalert2.css in nodemodules and customize it. Then I import it on a HOC wrote.
import Swal from 'sweetalert2';
import 'assets/styles/...
3
votes
2
answers
133
views
React - pass context to SweetAlert popup
My context is as follows:
import React, {createContext, useEffect, useState} from "react";
export const CartContext = createContext();
const CartContextProvider = (props) => {
const ...
0
votes
1
answer
49
views
Any alternative for the queue() function - SweetAlert2 v11.4.8
swal.queue is not a function TypeError: swal.queue is not a function
I would like to know the ways for the alternative of queue() function because it's now removed on the newer version. I tried ...
0
votes
0
answers
14
views
select2 fill when saving a new customer
I wish when saving a new client in the modal the fields of the invoice are automatically placed as you can see in the example of name email address
The only field that I need to fill in is the select2 ...
0
votes
1
answer
110
views
Is there a way to put a Pdf inside a Swal modal?
I'am making a button to when te user click, open up a Swal... the thing is, how can I put a Pdf view inside that swal modal, without send the user to another page?
It's possible to do that using the ...
1
vote
1
answer
51
views
Jquery Onclick functions wont work on second datatable's other pages
I have this datatables on my php but the jquery onclick functions only works properly on the first page but not the others.
the view data using modal works fine and the deleting of data as well but ...
0
votes
0
answers
34
views
$_POST is going empyt using sweet alert
I have a Customer class and a method to delete the customer:
public function deleteCustomer()
{
return (new Database('customers'))->delete('id ='.$this->id);
}
and .php file that is ...
0
votes
0
answers
7
views
SweetAlert icon not working properly after confirm
SweetAlert icon not working properly
Here my code:
function test(processID){
swal.fire({
title: 'alert?',
text: "Click Proceed!",
icon: '',
customClass: 'swal-wide',
showCancelButton: true,
...
0
votes
0
answers
11
views
Sweet alert 2 modal with input type range problems
my input
The image in the plan belongs to me, which is my purpose. How can I do that? I want a range input as in the image below. sweet alert2
enter image description here
enter image description here
...
1
vote
0
answers
44
views
Stop swal loading on success ajax request
I'm using sweetalert2 to pop up a dialog where users will input a pin.
The problem I'm facing is that I want to stop the button clicked from loading when the ajax request is completed.
So far I've ...
0
votes
0
answers
16
views
My SweetAlert2 does not show the other Sweetalert2 (Javascript)
Inside my code there is a SweetAlert that comes out when the process finishes, showing "Completed" and another one that should come out when the user exceeds 100 lines in a TextArea. However,...
0
votes
0
answers
54
views
Unable to call JS function on C#, ASP.NET MVC, Razor - SweetAlert2
I have a view (Create Users) and it has a button to create a user "Crear Usuario", the method works (GET/POST), but I want to implement SweetAlert2 (already added to my Content folder) and I ...
1
vote
2
answers
121
views
facing some issue to set type on sweetalert2
Typescript gave me 2 errors in the toastMixin variable and into the animation object. I didn't find any solution to solve it.
Error:
let toastMixin: typeof Swal
No overload matches this call.
...
0
votes
1
answer
83
views
How to call a bootstrap modal after sweetAlert2's confirm clicked?
I want to open a modal after clicking the confirm button of SweetAlert2. But nothing happens after clicking it.
I found this one and only, which is the same issue I'm having now.
I've tried the same, ...
1
vote
0
answers
319
views
SweetAlert2 with Vue 3 and <script setup>
I have the Laravel/Inertia app and I use VueSweetAlert2 imported globally in app.js.
It works well on every component. But now, I want to use on the component and I can't find working solution for ...
0
votes
2
answers
73
views
Hide div after page reloaded on sweet alert
i'm using sweetalert in ajax post data, and have a div element that i want to hide after page reload, from the code below what i can do to do that :
$(document).ready(function() {
$(document).on('...