Validation Form in jQuery: Burning Hours for a Semicolon

Yesterday I did a walkthrough with Rob Percival’s Udemy web development course to make a validation form.

This is what it is supposed to look like (Rob’s version).

Rob's Validation Form


This is what mine looked like with the walkthrough.


Leslie’s Jquery Validation Form

Pretty close, but compare the two after you have clicked the “Sign Up” button.

I have been searching for the last 2 hours to find out why my form won’t notify the user that a field is empty.

It is bumming me out.

I am sure it is a semicolon or something.

I have reread this code 20 times and I don’t see the difference between my code and Rob’s code.

I am hoping it is something I will figure out once I have completed another few lessons.

Or once I return to the Javascript / Jquery section of The Odin Project.

It is interesting to keep running into this syntax wall because I am finding that my learning in coding is a balance between diving as deep as possible and knowing when to let it go and move on.

Ideally, I would know why everything on a page is happening as it is and be able to troubleshoot every problem.

But there is also an element of burning lots of time in exchange for figuring out a syntax error (maybe) and that seems a little pointless.

As long as I do my best to keep good syntax, the individual lesson does not matter because the good syntax habit is forming as I continue to code more projects.

What I have noticed is that I do have a few habitual syntax mistakes (like forgetting to put the pound sign in when indicating an id in Jquery):

$("incorrectString") vs. $(#correctString)

It has been helpful to discover my habitual mistakes because I know where to look first when my code is not working.

But I have also learned that when I do these coding exercises on my own, it is helpful to put a time limit on my attempt.

This allows me to know where I am having challenges in the project so that when I learn the solution with the walkthrough I can focus on the things that were not working when I attempted to solve it on my own.

Essentially what I am saying is I am learning to learn better in the realm of programming. 🙂

But seriously, I cannot figure out why I my fieldsMissing variable is not working.

I look forward to taking a look at this in a few months when I know more.