+ 2
HTML/JS Do checkboxes return true/false? HELP
So I am trying to use checkboxes but I am not sure how it works. I want a user to select foods they don't like a submit a form. afterwards, I want to display the outcome using JS. I wrote some code but I don't know how to finish it up. How do I get it to work? How do I use the submit button? https://code.sololearn.com/WsM2dGQ3jp6P/?ref=app
13 Respuestas
+ 3
Yes they do:
https://code.sololearn.com/WnmO5CxDBRpG/?ref=app
+ 2
You are the master. Thank you 😊
+ 2
Thanks Kacper ☺
Note, it might be more suitable to do the form submit code in PHP (or whatever server-side language you're using).
Good luck! ☺
+ 2
I will, but I have to learn it first. I am learning JS at the moment I experiment with it to understand it better 😊
+ 1
Yes of course ☺ Best to learn one thing at a time.
+ 1
Yup. If I do all at once I will get lost at some point. It happened last year and I have up. I came back stronger this time 😊
+ 1
Xan How did you make the test submit button? I thought you only used a regular button instead of a submit button. But it doesn't work as it should on this code that I wrote now.
https://code.sololearn.com/WYBXFd0WhqJ2/?ref=app
+ 1
nevermind, I figured it out. All I had to do is remove the <button> out of the <form> tag. 😁
+ 1
Kacper Orłowski Great you worked it out ☺
+ 1
yeah. I have a good understanding of how coding works, but sometimes even the little things can be hard to spot 🤗
+ 1
Definitely! Even a highly experienced programmer will sometimes miss the little things! Indeed, the hardest bugs to fix, are often little (in coding terms) and intermittent. That's why unit testing is so powerful, and code reviews. We sometimes can't see our own mistakes, as easily as we can see someone else's.
+ 1
This is why I always ask the Sololearn community for help.
+ 1
That's great ☺ When learning programming, I think it's about balancing seeking help to early (so not improving our own debugging / problem solving skills), versus seeking help too late.