Skip to content

Checkboxes not working #2758

@Cybearnaut

Description

@Cybearnaut

Description

I am new to Twill CMS, I am not sure i did not configure things properly or what.
My Checkboxes is not clickable, whenever i click it, it shows an error in the console.

Image Image

I am not sure does it related to Migration files or Model or what, because i haven't setup any columns/fields on that yet,
but a JS error looks like frontend-only issue to me

Steps to reproduce

  1. Add the checkboxes field
<x-twill::checkboxes name="external_links" label="External Links" :options="[
            ['value' => 'website', 'label' => 'Website'],
            ['value' => 'facebook', 'label' => 'Facebook'],
            ['value' => 'instagram', 'label' => 'Instagram'],
            ['value' => 'other', 'label' => 'Other'],
]" />

I have also tried this in the controller, same issue

             Checkboxes::make()
                    ->default([])
                    ->name('external_links')
                    ->label('External Links')
                    ->options([
                        ['value' => 'website', 'label' => 'Website'],
                        ['value' => 'facebook', 'label' => 'Facebook'],
                        ['value' => 'instagram', 'label' => 'Instagram'],
                        ['value' => 'other', 'label' => 'Other'],
                    ]),
  1. Click on the checkbox, boom, nothing happens but an error in console

Versions

Twill version: 3.5.2
Laravel version: 11.44.2
PHP version: 8.2
Database engine: MySQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions