Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

akaydin's avatar
Level 19

FluxUI - flux:button not submitting the form.

I installed flux UI pro on a Jetstream project. Livewire does not throw errors when the form is completely empty, and the submit button does not seem to be working.

I tried replacing the flux:button with a standard button, and it is still not working. I extracted the form livewire class to a livewire\forms form. No matter what I tried, I could not solve the issue.

One reason might be, the form is in flux:tab.panel. Maybe it's avoiding the form to submit.

Has anyone had a similar problem?

0 likes
3 replies
LaryAI's avatar
Level 58

To troubleshoot the issue with the flux:button not submitting the form in your Jetstream project using FluxUI, you can follow these steps:

  1. Check Livewire Setup: Ensure that your Livewire component is correctly set up. Verify that the Livewire scripts are included in your layout file, typically in the head or just before the closing body tag:

    @livewireStyles
    ...
    @livewireScripts
    
  2. Form Submission Method: Make sure that your Livewire component has a method to handle the form submission. For example:

    class YourFormComponent extends \Livewire\Component
    {
        public $field1;
        public $field2;
    
        public function submitForm()
        {
            $this->validate([
                'field1' => 'required',
                'field2' => 'required',
            ]);
    
            // Handle form submission logic here
        }
    
        public function render()
        {
            return view('livewire.your-form-component');
        }
    }
    
  3. Button Configuration: Ensure that your flux:button is correctly configured to trigger the Livewire method. You can use the wire:click directive to call the submitForm method:

    <form wire:submit.prevent="submitForm">
        <flux:input type="text" wire:model="field1" placeholder="Field 1" />
        <flux:input type="text" wire:model="field2" placeholder="Field 2" />
        <flux:button wire:click="submitForm">Submit</flux:button>
    </form>
    
  4. Check for JavaScript Errors: Open your browser's developer console and check for any JavaScript errors that might be preventing the form from submitting.

  5. Isolation from Tabs: If the form is inside a flux:tab.panel, ensure that the tab panel is not interfering with the form submission. You might want to test the form outside of the tab panel to see if it works correctly.

  6. Update Dependencies: Ensure that all your dependencies, including Livewire and FluxUI, are up to date. Run:

    composer update
    npm update
    
  7. Debugging: Add some debugging statements in your Livewire component to ensure that the submitForm method is being called. You can use dd() or Log::info() to check if the method is triggered.

By following these steps, you should be able to identify and resolve the issue with the form submission. If the problem persists, consider providing more details or checking the documentation for any specific configurations related to FluxUI and Livewire integration.

merdin's avatar

Hi!

I have a similar problem now, anyone that has a fix for this?

Snapey's avatar

check you have livewire loaded on this page, and that the form is INSIDE a livewire component

Please or to participate in this conversation.