I know this probably staring me in the face but:
I have a basic for with a for header of:
the js looks at each input using: document.getElementById("name"). If it sees that the input is blank it colors the input yellow, selects it, and give is focus. Pretty simple, I use it on another form that has different inputs:
if(name == “”)
document.getElementById(“name”).style.backgroundColor = “yellow”;
I literally copied that from another function (just changed the variable and id to name). When I submit I can see it take the blank input yellow, then it reloads the whole form. My other forms work fine.