How to use SweetAlert2?

Page Head

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

Form Custom Validate event

function Form_CustomValidate(&$customError)
{  
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");
  }
});
}

The Popup not appear, Please Help me?

No need to include the javascript and css files that related to SweetAlert, since PHPMaker by default already used it.

Thanks for your reply,
How to use SweetAlert by default, would you please give me some example.

You may refer to the generated js/ew.js file. Make sure you did not enable Compress project .js option under Tools → Advanced Settings before re-generating ALL the script files.

I was try to uncheck compress .js under Tools Advanced Setting and wrote this code after generating code nothing happen while click Add button no popups message appear, i really confused why?

function Row_Inserting($rsold, &$rsnew)
{
    ?>
    <script>
    Swal.fire("SweetAlert2 is working!");
    </script>
    <?php
    return true;
}

You should not mix the Javascript code inside the PHP code.

You tried to use client side JavaScript in both Form_CustomValidate and Row_Inserting server events, it won’t work. You should use client side Form_CustomValidate event.