Whilst checking out the RedwoodJS docs today, I came across a neat little trick for using the JavaScript confirm() function to create a simple confirmation dialog.
The confirm() function is a built-in JavaScript function that displays a dialog with an optional message and two buttons: OK and Cancel. If the user clicks OK, the function returns true. If the user clicks Cancel, the function returns false.
Here’s a simple example of how you might use confirm() to create a confirmation dialog:
Docs are here: https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm