I have a page where there is a save button. If click the save button it submits the page and while submitting it gives the whole body an opacity and a loading animation. There are several input required in the page and when I save (submit) the page it checks the required inputs and gives the warning when it's not filled in. But it still gives the opacity and the loading animation (but does not submit, which is good).
Now my question is; how do I check if a input required is not filled in with a javascript function so I can then trigger the opacity (or not).