In this lecture, we are going to make one small adjustment to our upload form before creating a fallback
solution.
Do you understand why?
Let's test the upload form.
I'm going to drag and drop a file onto the uploader.
After doing so, I'm going to submit the form during the upload process.
I'm going to empty the field for the title.
After the upload was successful, let's check out the document in the Firebase console.
If you have that database open in another tab, the database should auto refresh.
If you don't see the document, you will need to manually refresh the page.
Looking closely at the new document, the title property is completely empty.
This problem occurs because we're creating the clip object after the file has been uploaded.
Users can still interact with the form during the upload process.
They can completely circumvent the form validation we've put in place to prevent this issue from happening.
We can disable the entire form.
Form groups and controls can be disabled.
As for groups, the entire set of controls are disabled.
For this solution, let's disable the group.
Switch over to your editor.
We're going to call the upload form disable function at the beginning of our function.
The disable function is available on all groups and controls by calling this function.
All controls within a group are disabled.
We should keep the controls disabled unless there's an error.
Error should cause the controls to be enabled to allow the user to edit their values.
Let's scroll to the error function at the top of the function, called the upload form.
Enable function.
The ANIE will function for forms, the opposite action of the disable function.
It'll enable the controls from within a group.
This solution is an alternative to manually binding the disabled attribute.
You're more than welcome to use either solution.
Let's try uploading a file switch over to your browser.
During the upload process, trying, clearing the title field.
Let's check out the document in the Firebase console.
By disabling the group, we've prevented the case of having an empty title.
Users shouldn't be able to submit new uploads without a title.
Great.
Let's add a fallback solution in the next lecture.