Questions tagged [sweetalert]
SweetAlert is a JavaScript library that provides a replacement for standard alert() dialogue.
1,021
questions
0
votes
1
answer
18
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
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
10
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
1
answer
31
views
Sweet Alert 2 Yes/No - How to integrate a function for PHP?
I use Sweet Alert 2 for nice dialogs.
Now I want to use it for a security question if an database entry should be delete or not.
It's no problem to show the dialog, but I can't find a way to integrate ...
0
votes
2
answers
75
views
+50
How to show json encoded array in Sweet alert message
I'm using Laravel 8 and Sweet Alert and I wanted to show the error messages that were caught by error Exception as Sweet Alert error popup message.
Basically here is my Controller method:
try{
...
}...
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
21
views
Rendering SweetAlert with correct styling
I am usiung sweetalert2@11.4.18 and vue-sweetalert2@2.0.5 and importing them like this:
import VueSweetalert2 from 'vue-sweetalert2';
import "sweetalert2/dist/sweetalert2.min.css";
Vue.use(...
1
vote
2
answers
53
views
Problem with SweetAlert Confirmation not flowing to server side procedure using asp.net button
hope someone can help me understand..
I have an asp.net project for which I have decided to use SweetAlert for a confirmation button.
I have followed suggestions in here:
Using SweetAlert2 to replace &...
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
1
answer
20
views
sweetalert not working in php after form submission
i have a simple php form, on form submit i want to display sweet alert, i did the following code:
<script src="https://unpkg.com/sweetalert2@7.8.2/dist/sweetalert2.all.js"></script>
&...
0
votes
1
answer
27
views
Sweet alert shows TRUE instead of alert text
I'm working with Sweet Alert to show some message so I coded this:
$(document).on('click', '#rules', function(e) {
swal({
html: true,
title: '<b>Title</b>',
text: '<b&...
0
votes
0
answers
33
views
How to add multiple title to sweet alert message pop up
I have a sweetalert alert box like this:
$(document).on('click', '#rules', function(e) {
swal({
title: "Title 1",
text: "Some text goes here",
type: &...
0
votes
2
answers
55
views
How to add/remove local storage item for duration so modal toggles?
Goal is to remove local storage item after 24 hours, meaning show modal only once per day everyday. The local storage value is set. However, my condition to check if local storage item does not exist ...
0
votes
0
answers
15
views
Sweet Alert added # in URL how to prevent it?
swal({
title: "Are you sure?",
text: "You won't be able to revert this!",
type: "warning",
...
0
votes
1
answer
21
views
How can i change the font-family of SweetAllert.js?
I am having a problem with changing the font-family of a sweetalert.
The script is bellow:
swal({
title: "Success!",
text: "You created your team.That's amazing!&...
0
votes
0
answers
10
views
sweet alert destroy method returns null blank page with no request
i am using sweet alert method framework to show the alert when deleting but when i do this at destroy method return Request() or return $request it returns blank page with no requests or results i don'...
0
votes
1
answer
37
views
when i click to delete button for yes delete it but record is not deleting using jquery
i am trying to delete my record when i click to yes delete button but record is not deleting please help me how can i resolved that thank u.
message confirm delete
html view
<a href=&...
0
votes
0
answers
31
views
Delete confirmation using SweetAlert in ASP.Net Core MVC
How to use sweetalert confirm deleting in my project
i am using asp.net MVC core 5.0
I'm trying to make delete confirmation for category. When user click this button in Index.cshtml it will show ...
-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=&...
0
votes
1
answer
41
views
Using sweet alert toast for error handling in vuex
I have installed sweet alert on my project.
Now i want to use it in Vuex actions but it does not work.
update({ commit, dispatch }, data) {
return new Promise(async (resolve, reject) => {
try ...
0
votes
1
answer
37
views
Javascript - How to select "x" row
I have this list made on sweetalert2
*** this is the code ***
function detalleTransf(matricula, bancoorigenTransf, cbu_cta_origen, titular_cta_origen, ultimos_digitos_cta_origen) {
var ...
1
vote
0
answers
19
views
JS + sweetalert - insert values from checkbox to input field
I must select from a window (done with sweetalert2) a row.
And insert them according to the column in each input of the following image
This is the code of the pop up...
function detalleTransf( ...
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 ...
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
51
views
How to use Sweet Alert to send ajax DELETE request in Rails?
Problem 1: When I click the link, the sweet alert modal pops up for a split second, disappears, and redirects to route. Not sure why the modal is only flashing when it should stay until option chosen. ...
0
votes
1
answer
47
views
How to recognize Id attribute in rails form_tag?
I am using a form in rails to pass an id. That id will trigger the javascript Sweet Alert function which will pop up a modal with a confirmation message. When the message is confirmed "Yes" ...
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
13
views
Why doesn't SweetAlert display its CSS? SweetAlert don´t work´s
I tried using Sweet Alert but I don't know why despite displaying the alert its appearance conflicts.
Here the footer code
<script src="<?= media(); ?>/dashboard/vendor/js/menu.js"&...
0
votes
1
answer
46
views
how do I get a text input using Sweet Alert
So, I'm using a Sweet Alert with content: "input", to enter a message, such as "hello world", but the resulting value is always [object Promise]. I have looked at other similar ...
0
votes
1
answer
24
views
Best practices for in scope of creating wrapper methods for Swal with preset configuration
I have such a class with such static methods.
import Swal from 'sweetalert2'
export class AlertService {
static errorMessage(title = 'Error', text = 'Error') {
Swal.fire({
icon: 'error',...
0
votes
0
answers
45
views
closing a project in database by clicking a button
I need to close a project on database by clicking the reject button. This is my codes for the ui of the reject button. and on the comment part is the code I have in another file that can close the ...
0
votes
2
answers
71
views
disable two buttons after clicking reject/close
My task is to be able to disable the approve and return buttons after clicking the reject button. Reject button means closing a project. These are my codes. Can anybody help me figure out how to ...
0
votes
1
answer
293
views
AWS Amplify error: Failed to parse source map... file: Error: ENOENT: no such file or directory
Using Amplify to deploy my React app (created with create-react-app) and I get the following error.
2022-04-26T18:52:09.555Z [INFO]: Failed to parse source map from '/codebuild/output/src963792318/src/...
0
votes
0
answers
28
views
center sweetalert input textbox
I'm trying to center an input textbox using sweet alert.
Do you have any idea how to do this?
Attached are the screenshot and the code.
Thanks!!
swal({
title: "Title",
text:...
0
votes
0
answers
71
views
Sweetalert2 Mandatory date field
Hello I have a sweetalert2 popup which when clicked calls an api method. What I am trying to accomplish is to have a datepicker input field which is mandatory if they click Yes button. I need to pass ...
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
42
views
My function sweetalert is not working on click
I am a beginner in JavaScript. I want to add a sweetalert to my webpage when the user click on the button to upload a files. If he has selected nothing, so the list of files is empty it should appear ...
0
votes
1
answer
45
views
How to disable jquery swal confirm button initially
In my jquery project, I'm using swal with checkboxes like the below screenshot.
I want to enable/disable the swal confirm button based on checkboxes value and also initially disable swal confirm ...
0
votes
0
answers
73
views
How to make sweetAlert (swal) behave like the regular js alert function?
I am trying to make a "sweetalert2" box appear when the number of coins in a running game is 20. (I want to let the user know that they have reached 20 coins). If I just used alert, an alert ...
0
votes
1
answer
66
views
how to catch response and display the exception handle in back-end in angular
i am trying to catch the response and display in the browser when data is not found but i didn't got idea how to do it when response is in array.
In the postman response is in following way:
[
{
"...
0
votes
1
answer
48
views
Datatables.net and sweetalert
So I am using Datatables and every row has a delete button at the end, which I use in combination with Sweetalert.
I have 10 results per page and if for example there are more pages, and I go to the ...
1
vote
0
answers
12
views
How do I use a custom confirmation method when window.onbeforeunload happens [duplicate]
I'm using SweetAlert on all my pages and I want to be able to use that in order to preserve the consistency of style on my site whenever the user tries to leave the page with unsaved changes.
The ...
0
votes
1
answer
76
views
SweetAlert Icon overflow-y
I have an issue modifying my website. When I call Swal.fire(...), something like this happens:
Icon on the picture overflows and not renders properly(seems like scrollbar affects on icon render). How ...
0
votes
0
answers
41
views
how to link my sweetalert to another page in php echo tag?
I'm using sweet alert to send the user a warning message that show to them that the information insert is not valid in PHP echo. I want the "okay" button link to the desire page but it just ...
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, ...
0
votes
1
answer
55
views
Custom messages in SweetAlert with PHP variables
I would like to use a return variable from my PHP file to display a custom message of possible errors in SweetAlert. It is possible?
File PHP:
if ($a > $b) {
echo "true";
$msg = ...
0
votes
0
answers
132
views
Sweet alert wait for reaction
Alert does not wait for user response and the form completes, Does anyone know how to solve this problem?
I need it in response to a button that is not on the form because I have several buttons on ...
0
votes
0
answers
51
views
Dynamic populate dropdown for Sweetalert2
I am trying to populate a dropdown option for a SweetAlert alert by passing an array or string list from my MVC controller to view.
I can get the values to populate in the dropdown but when the text ...