F
Filamentβ€’11mo ago
BKF Dev

Wizard submit button

Hi, how can I show the submit button only on the last step ?
12 Replies
BKF Dev
BKF Devβ€’11mo ago
Unfortunately no, it's there :/
josef
josefβ€’11mo ago
Are you sure, it's not a submit button outside the form (e.g. in the template)? the wizard definitely only shows it on the last step
LeandroFerreira
LeandroFerreiraβ€’11mo ago
share the code
BKF Dev
BKF Devβ€’11mo ago
BKF Dev
BKF Devβ€’11mo ago
I'm using multi-tenancy public function form(Form $form): Form { return $form ->schema([ Wizard::make([ Step::make('Information') ->schema([ $this->getNameFormComponent(), $this->getEmailFormComponent(), $this->getPasswordFormComponent(), $this->getPasswordConfirmationFormComponent(), ]), Step::make('Details') ->schema([ Toggle::make('is_man'), TextInput::make("phone") ->required(), Select::make("country") ->required() ->searchable() ->options(function () { $countries = []; foreach (config('countries') as $key => $value) { $countries[$value['name']] = $value['name']; } return $countries; }), DatePicker::make("born_at"), TextInput::make("study_level") ]), Step::make('School') ->schema([ Select::make('school_id') ->options(School::all()->pluck('name', 'id')) ->preload() ->required() ->searchable() ]), ]) ]) ->statePath('data'); } use Filament\Pages\Auth\Register; ... class StudyRegister extends Register { ...
josef
josefβ€’11mo ago
Yeah, that sign-up button is not part of the wizard look in your view file
BKF Dev
BKF Devβ€’11mo ago
But I'm using Filament\Pages\Auth\Register; of filament the StudyRegister page extends Filament\Pages\Auth\Register filament page
LeandroFerreira
LeandroFerreiraβ€’11mo ago
StudyRegister.php
protected static string $view = 'custom-register-form';
protected static string $view = 'custom-register-form';
<!-- resources/views/custom-register-form.blade.php -->
<x-filament-panels::page.simple>
@if (filament()->hasLogin())
<x-slot name="subheading">
{{ __('filament-panels::pages/auth/register.actions.login.before') }}

{{ $this->loginAction }}
</x-slot>
@endif

<x-filament-panels::form wire:submit="register">
{{ $this->form }}
</x-filament-panels::form>
</x-filament-panels::page.simple>
<!-- resources/views/custom-register-form.blade.php -->
<x-filament-panels::page.simple>
@if (filament()->hasLogin())
<x-slot name="subheading">
{{ __('filament-panels::pages/auth/register.actions.login.before') }}

{{ $this->loginAction }}
</x-slot>
@endif

<x-filament-panels::form wire:submit="register">
{{ $this->form }}
</x-filament-panels::form>
</x-filament-panels::page.simple>
BKF Dev
BKF Devβ€’11mo ago
Yes I tried it, but the submit button never appears :/ this is my page : <x-filament-panels::page.simple> <style> .fi-simple-main { max-width: 60rem; } </style> @if (filament()->hasLogin()) <x-slot name="subheading"> {{ __('filament-panels::pages/auth/register.actions.login.before') }} {{ $this->loginAction }} </x-slot> @endif <x-filament-panels::form wire:submit="register"> {{ $this->form }} <x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" /> </x-filament-panels::form> </x-filament-panels::page.simple> If I remove that form.actions, the button wont be exist at all
BKF Dev
BKF Devβ€’11mo ago
Yes ! it works thanks πŸ™‚ I found an other way for this : @if ($data['school_id']) <x-filament-panels::form.actions :actions="$this->getCachedFormActions()" :full-width="$this->hasFullWidthFormActions()" /> @endif Here the school_id is the last required field, so I display submit button on its value πŸ™‚