I created a course registration page that allows you to choose a course and then a section. Right now, you can choose a course and a section that doesn't fit the course.
I want to create validation code that ensures that my course section is valid for for my course. Here's what I'm trying:
Bear Bibeault wrote:Exactly how is it not working? What's happening differently than your expectations?
Have you learned how to set breakpoints to help with debugging?
This bit of code doesn't display the "You must select a valid section for CIS 100!" message, if the person selects an incorrect section. It also bypasses the confirmation message and goes straight to the form processor on the next page. I do not know about breakpoints.
I tried it with a switch statement and it works to tell you if it you choose the incorrect section, but if you choose the right section it skips the rest of the validation (because it's returning true), doesn't print the confirmation message, and advances straight to the form processor page. Any idea of how I can do this without returning true?