Select and FIle Upload

Is there a way to update the options in the select field based on the uploaded file?
6 Replies
Patrick Boivin
Can you describe what you're trying to do exactly? What's the use-case for this?
Lacunacoil
LacunacoilOP2y ago
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.
Lacunacoil
LacunacoilOP2y ago
Here's the snippet of the FileUpload and TextInput
Lacunacoil
LacunacoilOP2y ago
And this is the Select
Patrick Boivin
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 submit
Lacunacoil
LacunacoilOP2y ago
Would add the dehydrated. I think having the hidden input will force update the dom making the options updated.

Did you find this page helpful?