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
12 Replies
If memory serves, you can use ->wizard() instead of ->form()
I have already use wizard()
Then you just need to remove the submit button from the form 🙂
Share your code. Your doing something wrong otherwise it shouldn’t show.
please once see the above code
->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
Are you using a modal?
https://filamentphp.com/docs/2.x/admin/resources/creating-records/#wizards
CreateAction::make()
->steps([
// ...
])
Well, these two guys are kind on you. But do you really expect people to read that totally unformatted code? 🙈
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
Ensure you use:
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') ```
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') ```
Thank you so much sir
it works
this line