Custom page with InteractsWithForms trait - select field issue
Hello,
I'm having an issue on my custom page where I've added the "InteractsWithForms" trait to incorporate a form.
I've created the form(Form $form) function that returns a form (in my case, a special filter for my page). In this form, I have "DatePicker," "Select," "TextInput," and "ToggleButtons" fields.
I have an applyFilter function that allows me to filter my data. The problem is that I can retrieve the values from each field except for those from the "Select" fields. Moreover, if I set the fields to required, the select fields generate an error during the form validation as if the selected value was not taken into account. Where could the problem be coming from?
Here is the simplified code :
The html :
And the dd() with a selected value in the select field :
2 Replies
Solution
Did you add
$this->form->fill()
in the mount method?Oh, that's exactly what it was! Thank you so much 👍