Wizard submit button
Hi, how can I show the submit button only on the last step ?
12 Replies
Unfortunately no, it's there :/
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
share the code
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
{
...
Yeah, that sign-up button is not part of the wizard
look in your view file
But I'm using
Filament\Pages\Auth\Register;
of filament
the StudyRegister page extends Filament\Pages\Auth\Register filament pageStudyRegister.php
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 allYou need to add the submit button
https://filamentphp.com/docs/3.x/forms/layout/wizard#rendering-a-submit-button-on-the-last-step
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 π