Disable 'Create' and 'Create & create another' buttons until all required fields are filled
I'm using a form with multi-step wizard, where each step has some required fields. Now, while create button doesn't work until all validation conditions are met; it is difficult to see the issue if you click on it at a certain step in the wizard, whereas the validation issue is on some other step.
Is there a way to disable/hide these buttons until all validation conditions (such as required fields) are met? Alternatively, can it be made to jump to the step containing the first validation issue?
4 Replies
Bumping!
I think you're using wizard in a wrong way, you shouldn't have
create
and create_another
button, you need to have next
and previous/cancel
and submit
at last step, follow this for more https://filamentphp.com/docs/3.x/panels/resources/creating-records#using-a-wizardExample on demo https://demo.filamentphp.com/shop/orders/create
The reason I'm embedding the wizard inside a form is because I'm using this form elsewhere as well, for example in
createOptionForm()
method
Is there a way to use HasWizard trait with simple resources?