sweet alert

Solutions on MaxInterview for sweet alert by the best coders in the world

showing results for - "sweet alert"
Lucia
05 Nov 2020
1Swal.fire({
2  title: 'Do you want to save the changes?',
3  showDenyButton: true,
4  showCancelButton: true,
5  confirmButtonText: `Save`,
6  denyButtonText: `Don't save`,
7}).then((result) => {
8  /* Read more about isConfirmed, isDenied below */
9  if (result.isConfirmed) {
10    Swal.fire('Saved!', '', 'success')
11  } else if (result.isDenied) {
12    Swal.fire('Changes are not saved', '', 'info')
13  }
14})
Anae
25 Jun 2016
1swal("Good job!", "You clicked the button!", "success");
Mike
20 Apr 2019
1Swal.fire({
2  title: 'Are you sure?',
3  text: "You won't be able to revert this!",
4  icon: 'warning',
5  showCancelButton: true,
6  confirmButtonColor: '#3085d6',
7  cancelButtonColor: '#d33',
8  confirmButtonText: 'Yes, delete it!'
9}).then((result) => {
10  if (result.isConfirmed) {
11    Swal.fire(
12      'Deleted!',
13      'Your file has been deleted.',
14      'success'
15    )
16  }
17})
Nicola
03 Mar 2019
1Swal.fire(  'Good job!',  'You clicked the button!',  'success')
Kyla
19 Jun 2017
1// Add the product name as data argument to Ajax add to cart buttons
2add_filter( "woocommerce_loop_add_to_cart_args", "filter_wc_loop_add_to_cart_args", 20, 2 );
3function filter_wc_loop_add_to_cart_args( $args, $product ) {
4    if ( $product->supports( 'ajax_add_to_cart' ) && $product->is_purchasable() && $product->is_in_stock() ) {
5        $args['attributes']['data-product_name'] = $product->get_name();
6    }
7    return $args;
8}
9
10// On Ajax added to cart, shows a lightbox with the product name (and the product id)
11add_action( 'wp_footer', 'ajax_added_to_cart_popup_script' );
12function ajax_added_to_cart_popup_script() {
13    ?>
14    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
15    <script type="text/javascript">
16    jQuery( function($){
17        // On "added_to_cart" live event
18        $(document.body).on('added_to_cart', function( a, b, c, d ) {
19            var prod_id   = d.data('product_id'), // Get the product name
20                prod_qty  = d.data('quantity'), // Get the quantity
21                prod_name = d.data('product_name'); // Get the product name
22
23            Swal.fire({
24                title: '<?php _e("Added to cart!"); ?>',
25                text: prod_name+' ('+prod_id+')',
26                showCancelButton: true,
27                confirmButtonColor: '#000',
28                cancelButtonColor: '#3085d6',
29                confirmButtonText: '<?php _e("View-cart"); ?>',
30                cancelButtonText:  '<?php _e("Continue shopping"); ?>'
31            }).then((result) => {
32                if (result.value) {
33                    window.location.href = '<?php echo wc_get_cart_url(); ?>';
34                }
35            });
36        });
37    });
38    </script>
39    <?php
40}
41
Elena
26 Oct 2017
1swal("Good job!", "You clicked the button!", "error");
Tess
04 Mar 2020
1swal("Hello world!");
queries leading to this page
swal sweetalertget swal input optionssweet and decosweetalert confirm dialogwarning in sweet alertsweet alert demosbootstrap swalrequire 28 27 2fsweetalert css 27 29 3bsweet captchaswal showloading 28 29 hidealert dialog using sweet alert dialog javascriptsweet alert scriptsweet alert alert boxpatternfly org sweet alertsweet notification bootstrapsweet alert dialogssweetalert example with function jsswal1 optionsswal icon listsweet alert stylingjs how to call swall in htmlfetch sweetalertsweet alert in jssweetalert csnsweet alert niputsweet alert buttonssweetalert bootstrapsweetalert htmladd sweetalert in bootstrapswal alert string validation with error on same popupsweet alert jquerysweetalert2 github iosweet alert jssweetalert js examplesweet alertssweet alerts bootstrapusing sweet alertsweetalert styleswal with inputjs swal buttonjavascript sweet alert cancel buttonsweetalert2 npmsweet alert pluginjavascript alertsweet alert inputsweetalert close on denysweetalert2 functionswal ajaxsweetalert csssweetalert jssweetalert popupsweet alert for bootstrapsweetalert2 jsswal confirm yes or noimplementation sweetalert bootstrapsweet alert fail alertsweet alert result datanpm sweetalert2 customizesweet alert oksweete alertsweetalert onclosesweet alert 282 29 with the buttons delete and cancelsweet alert swalsweetalert bootstarpsweetalert2 vs sweetalertsweat alert float top rightsweet alert confirmsweet alert bootstrap with inputsseetalert 3 icons sweet alert select optionsweetalertsweetalret theme with reactsweet alert in jquerysweetalert2 show input errorsweet alert messagesweetalert swal firesweetalert2 multiple alerts for one timesweet alert usagesweet alert bootstrap 4sweet alert in htmlsweet alert bootstrap confirmswal info alertjavascript alert librarysweetalert after headersweet alert docinput box in sweetalertswal radiosweetalert2 action on button presssweat alerts sweetalertsweet alert jsweetalert2 animationhow to use sweetalert in sweetalert2swith alertswal on loadswal confirmsweet alert 2 not showingsweetalert custom classsuite alert ui javascripthow to add a class in sweetaleret inputsweet alert with input fieldsweet alert warningswal sweet alertsweetalert jquery sweetalert guidesweet boxsweet alert dangerjs pop with swalsweet alert 2 ajaxsuccess sweet alertsweet alert optionssweet alert register successsweet alert popup display htmladd sweetalertsweetalert2 examplesweetalert inputhow to add alert swal to buttonsweet plaidalert js libraryswal select stylesweetalert textcontnt ajaxtimed sweet alert successuse sweetalert with input fieldsweetalert 2sweetalert javascript stylesweetalert2 add javascriptsweet alert javascriptsweet alert dialogreact sweat alert imagesweetalert documentationswal show loading on confirm buttondanger sweet alert sweetalert dialognpm install sweetalert2sweet alert 2 alertsswal success timersweet alert 2jssweetalert2 swalsweetalert2 for htmlbootstrap sweetalert cdnajax in sweetalerthttps 3a 2f 2fsweetalert js org 2fnotification sweet hearts bootstrap 22sweetalert 22 3a 22 5e2 1 2 22 2csweet alert info messagesweet alert swal close jssweetalert javascriptswal input textsweet alert examplessweet alert yes nosweetalerts jsswal danger modesweetalerts2 npmsweet alert 2 htmlsuite alert ui javascriptsweetalert 2 1 2sweetalert exampleswal delete iconswal alertcustom style sweet alert radio button 24this 3ealert 28sweetalerthow to use sweetalert in jssweet alert button actionsweetalert2 bootstrapsweet alert buttonsweetalert js libraryjs alertswall sweet alertsweetalert questionswal confirmationmodify style swal buttonsweet alert bootstrapswetalert inputsweet alert jquery pluginsweetalert popup when click on buttonhow to use sweetalertsweet alert 2put are you sure sweetalert on a buttonsweet alert bootstrap exampleswalclose sweetalert2import swal from 27sweetalert2sweet alertdanger in sweetalert jssweet alert quesweet alert prompt filedsweetalert to small bootstrapbootstrap sweet alertswal fire javascriptswal bootstrapsweetalert2 sumitingsweet alert js cdn latestsweet alert errorsweetalert 2 jqueryhow to pop up the sweetalertsweetalert 22confirmbuttonclass 22bootstarp sweetalertsweetalert w3schoolssweet alert cakephpsweetalert2 multiple alertssweet alert close popupsweet alert successbootstrap sweetalerthow to import bootstrap sweetalertsweetalert usagejavascript alert librariessweet alert for confirmuse sweet alert in jshttps 2f 2fsweetalert js orgsweet alert messagessweet alert libraryswal error warningbootsrap sweetalertswal promisesweat alertfrom where swal style classes comesweet alert css documentswal settimeoutsweet htmlswal alert promptjs library for alertsweetalert docswal success alertsweet alert input valuesweet alert codesweet dialogjs sweet alertsweet alert 2 firebig sweet alertsweet alert success messagesweetalerts jsjquery sweetalertswal js 2sweetalert2 successsweetalert2 sweet alert documentationstyle sweet alertsweetalert2sweet alert docssweetalert cdnclose button swalsweetalert jquertsweet js 2download sweetalertswal warning alertsweet alert bootstrap htmlsweet alert