We have a changeset backing the above input fields in a schema. Now when the file is directly uploaded to S3, we must show an error message if the changeset fails the required validation for both fields. The text field works fine because the error message is handled automatically by liveview.
But how do we handle the live_file_input to ensure the file was actually uploaded? The changeset will not persist without the url being part of the changeset.
How do we provide interactive error message with file input just like the error message with the text input?
One option is the have the “required” attribute specified on the live_file_input tag which the browser then handle by itself natively and won’t let the form be submitted.