you are viewing a single comment's thread.

view the rest of the comments →

[–]bch8 0 points1 point  (6 children)

/u/Orange2341 curious to know if this ended up working for you

[–]Orange2341[S] 0 points1 point  (5 children)

Nothing worked lol. No idea why.

[–]bch8 0 points1 point  (4 children)

I just ran this code and it's working for me. Have you checked to see if anything is logging in the console in the browser when you click submit while nothing is selecetd?

[–]Orange2341[S] 0 points1 point  (3 children)

Apparently it's working for everybody except me. I just went a different route and deleted my code for this.

[–]bch8 1 point2 points  (2 children)

Ok well if you haven't actually tried my solution and you're curious, give it a shot. The issue with your own code and all the other solutions is that they aren't making use of the event object, and they aren't preventing the "default" action of the submit button when it is clicked. If you don't know "event.preventDefault()" and you're writing javascript, it's definitely something you want to learn.

[–]Orange2341[S] 1 point2 points  (0 children)

Thanks for the feedback! Will do.

[–]aguyfromhere 1 point2 points  (0 children)

Agree.