Unit 5 Ch 1 Lesson 6?


#1

I have a question in regards to programming in Unit 5 Ch 1 Lesson 6. I have completed coding for level 18 - it works except when Monday is selected. I know it has to do with the onEvent “drop” “change” because Monday is not changed, there is no message selected. This will only happen the first time the program is run; otherwise the program is good. I am providing the code below. Any help would be appreciated.

onEvent(“dropdown1”, “change”, function() {
if (getText(“dropdown1”) == “Saturday”) {
setText(“msg_label”, “It’s the weekend! Stay home!”);
} else if ((getText(“dropdown1”) == “Sunday”)) {
setText(“msg_label”, “It’s the weekend! Stay home!”);
} else {
setText(“msg_label”, “It’s a weekday. Go to school!”);
}
});
//comment Monday doesn’t work because it is not changed need to figure this out


#2

If you look at the example solutions, the same bug is there too. If you add “Pick one” or something similar as the first option, then you will be able to pick Monday if you want. Although, then you would get “It’s a weekday, go to school” unless you added a line for “Pick one”.


#3

Thank you for your assistance.