Answers for "sweetalert2"

0

sweetalert2

Swal.fire(
  'Data Add Successfully!',
  'You clicked the button!',
  'success'
)
Posted by: Guest on August-31-2021
1

sweetalert2

$ npm install sweetalert2
Posted by: Guest on February-07-2021
0

sweet alert 2

Swal.fire({
  title: 'Do you want to save the changes?',
  showDenyButton: true,
  showCancelButton: true,
  confirmButtonText: `Save`,
  denyButtonText: `Don't save`,
}).then((result) => {
  /* Read more about isConfirmed, isDenied below */
  if (result.isConfirmed) {
    Swal.fire('Saved!', '', 'success')
  } else if (result.isDenied) {
    Swal.fire('Changes are not saved', '', 'info')
  }
})
Posted by: Guest on August-03-2021
0

sweetalert2 if else

swal({
  title: 'Input something',
  input: 'text',
  showCancelButton: true,
  inputValidator: function(value) {
    return new Promise(function(resolve, reject) {
      if (value) {
        resolve();
      } else {
        reject('You need to write something!');
      }
    });
  }
}).then(function(result) {
  swal({
    type: 'success',
    html: 'You entered: ' + result
  });
})
Posted by: Guest on December-16-2020
0

sweetalert2

Swal.fire(
  'Good job!',
  'You clicked the button!',
  'failed'
)
Posted by: Guest on July-20-2021
0

sweetalert2

const { value: email } = await Swal.fire({  title: 'Input email address',  input: 'email',  inputLabel: 'Your email address',  inputPlaceholder: 'Enter your email address'})if (email) {  Swal.fire(`Entered email: ${email}`)}
Posted by: Guest on November-17-2020

Browse Popular Code Answers by Language