F
Filament9mo ago
Itachi

How remove this submit button

how remove this submit button when topics are not select in topics it only show next button and after select topic then it show submit and cancel button
No description
12 Replies
toeknee
toeknee9mo ago
If memory serves, you can use ->wizard() instead of ->form()
Itachi
Itachi9mo ago
I have already use wizard()
toeknee
toeknee9mo ago
Then you just need to remove the submit button from the form 🙂
Dennis Koch
Dennis Koch9mo ago
Share your code. Your doing something wrong otherwise it shouldn’t show.
Itachi
Itachi9mo ago
Action::make($title)
->form([
Wizard::make()->schema([
Wizard\Step::make('TOPICS')->schema([
Radio::make('TOPICS')
->options($tcards)
->required()
->reactive()
]),
Wizard\Step::make('Lesson')->schema([
Radio::make('LESSONS')
->hidden(fn (Closure $get) => $get('TOPICS') === null)
->required()
->options(function (Closure $get) {
$topics=$get('TOPICS');
$topic = Topic::where('id',$topics)->first();
$lcards = [];

if($topic){
$lessons=$topic->lessons()->pluck('title','id')->all();
foreach($lessons as $ltitle){
$lcards[]=$ltitle;
}
}
return $lcards;
})
])
])
->submitAction(false)
])
->size('lg')
Action::make($title)
->form([
Wizard::make()->schema([
Wizard\Step::make('TOPICS')->schema([
Radio::make('TOPICS')
->options($tcards)
->required()
->reactive()
]),
Wizard\Step::make('Lesson')->schema([
Radio::make('LESSONS')
->hidden(fn (Closure $get) => $get('TOPICS') === null)
->required()
->options(function (Closure $get) {
$topics=$get('TOPICS');
$topic = Topic::where('id',$topics)->first();
$lcards = [];

if($topic){
$lessons=$topic->lessons()->pluck('title','id')->all();
foreach($lessons as $ltitle){
$lcards[]=$ltitle;
}
}
return $lcards;
})
])
])
->submitAction(false)
])
->size('lg')
please once see the above code
toeknee
toeknee9mo ago
->submitAction(false) is on the wizard, you want it on the form if you want to disbale the forms submit action in turn of the wizard if memory serves me correctly
Dennis Koch
Dennis Koch9mo ago
Well, these two guys are kind on you. But do you really expect people to read that totally unformatted code? 🙈
Itachi
Itachi9mo ago
sorry sir, i had already copyed formatted code from vs code and pest it but why it automatically converted to unformatted code, i donot know from next time i will take care of it yes sir
toeknee
toeknee9mo ago
Ensure you use:
```php
```php
wrappers for the code before pasting.
wrappers for the code before pasting.
php Action::make($title) ->form([ Wizard::make()->schema([ Wizard\Step::make('TOPICS')->schema([ Radio::make('TOPICS') ->options($tcards) ->required() ->reactive() ]), Wizard\Step::make('Lesson')->schema([ Radio::make('LESSONS') ->hidden(fn (Closure $get) => $get('TOPICS') === null) ->required() ->options(function (Closure $get) { $topics=$get('TOPICS'); $topic = Topic::where('id',$topics)->first(); $lcards = [];
if($topic){ $lessons=$topic->lessons()->pluck('title','id')->all(); foreach($lessons as $ltitle){ $lcards[]=$ltitle; } } return $lcards; }) ]) ]) ->submitAction(new HtmlString('<button type="submit">Submit</button>')) ]) ->modalActions([]), ->size('lg') ```
Itachi
Itachi9mo ago
Thank you so much sir it works
->modalActions([]),
->modalActions([]),
this line