Skip to main content

Deleting Records with Confirmation Prompt

Premium
2:43

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

bitvalentine avatar

Just encase you need to copy/paste

onclick=" return confirm('Are you sure?') || event.stopImmediatePropagation ()"

👍 1
😍 1
Dale Nicholson avatar

Hopefully there's a better way to do the confirmation in Livewire. As said at the beginning of the tutorial, Livewire helps devs write zero JS. But now, we're just written a line of JS. Yes, it's only minor. But still :)

Nerijus avatar

Well yeah you can. You can make your own confirmation modal even with a native html dialog element and call it. But this is way quicker and simple. Or you can use something like sweetalert