© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
josef

Open a modal from checkbox label

Hey y'all,

I'm trying to open a modal from a Checkbox label to show terms and conditions.
Do achieve that I inserted a modal component into the template for every agreement, that do show up in the rendered page with the correct id.
Then I use a HtmlString for the label to dispatch the
open-modal
open-modal
event with the agreement's id. Button looks ok in the code:
$label = new HtmlString("<button type='button' x-on:click=\"\$dispatch('open-modal', { id: '{$id}' })\">{$agreement['title']}</button>");
$label = new HtmlString("<button type='button' x-on:click=\"\$dispatch('open-modal', { id: '{$id}' })\">{$agreement['title']}</button>");

Unfortunately, when I click the label/button, nothing happens, event though the id is present and it looks alright to me.
Any ideas?
image.png
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Open modal from input field label
FilamentFFilament / ❓┊help
3y ago
open modal from another modal
FilamentFFilament / ❓┊help
3y ago
open a modal from a navigationitem
FilamentFFilament / ❓┊help
16mo ago
Checkbox Confirmation Modal
FilamentFFilament / ❓┊help
13mo ago