How to check if Fileupload is filled
How to check a fileupload component is filled, like in the code
below I want to enable the toggle component only when textinput
and fileupload is filled..
I tried $get('attachments') to no avail
1 Reply
Sometimes I find it better to use $set from the conditional component, to tell the destination component what to do. A good example in the docs is setting a slug from a title textfield. https://filamentphp.com/docs/3.x/forms/advanced#generating-a-slug-from-a-title
I imagine if you combine it with a $get on the other field you can make the two work together to determine the status of the 3rd. ie: on both the text and file field put some logic that gets the value of the other, and if the values for those two "pass" then $set the toggle field.
I imagine if you combine it with a $get on the other field you can make the two work together to determine the status of the 3rd. ie: on both the text and file field put some logic that gets the value of the other, and if the values for those two "pass" then $set the toggle field.