Select and FIle Upload
Is there a way to update the
options
in the select
field based on the uploaded file
?6 Replies
Can you describe what you're trying to do exactly? What's the use-case for this?
It's like a modal that has steps inside. The first step is the uploading of the CSV. The second step is where the user matches the CSV columns to the system's database.
I currently did a hacky workaround by creating a hidden text input. And then
afterStateUpdated
of the FileUpload
I $set
the value of the hidden input.Here's the snippet of the
FileUpload
and TextInput
And this is the
Select
The hidden field is not a bad idea actually... I think I would add a
->dehydrated(false)
to make sure the data is ignored on submitWould add the
dehydrated
. I think having the hidden input will force update the dom making the options updated.