1. Milliseid muusikuid/ansambleid sa tead?
Queen
Imagine Dragons
Bts
Metallica
2. Mida arvad muusika kuulamisest koolis?
3. Kui palju tunde päevas sa muusikat kuulad?
0
4. Kas sa kuulad raadiot?
Jah Ei
Milliseid raadiojaamu oskad nimetada?
6. Millist muusikat sa kõige rohkem kuulad?

This is a music questionnaire. It contains several questions:

Which musicians or bands do you know?
Here are checkboxes you can select – Queen, Imagine Dragons, BTS, Metallica. Every time you check or uncheck a box, the Select function is triggered.

What do you think about listening to music at school?
Here is a text area where you can write your opinion. When you write, the Write function is triggered.

How many hours per day do you listen to music?
This is a slider from 0 to 24. When you move the slider, the slider function is triggered.

Do you listen to the radio?
Here are options: Yes or No. When you select an option, the selectAnswer function is triggered.

Which radio stations do you know?
Here you can write, and there are also suggestions like Europa+, DFM, and others. When you write, the selectStation function is triggered.

What type of music do you listen to the most?
Here is a dropdown menu where you can choose a genre such as rock, pop, rap, and others. When you select, the selectGenre function is triggered.

INext to each question, there is an empty space where answers or comments will likely appear. At the bottom, there are two buttons: Submit, which sends the answers, and Clear, which resets the form. There is also a space where an overall result may appear.

This form collects information about a person’s opinions on music and what they listen to. Each time an answer is changed, the corresponding function is triggered, but the code for these functions is not included here. If you want, I can help write them.

This is a script that handles processing the responses in the music questionnaire form.

  • Function Select() checks which checkboxes for musicians (Queen, Imagine Dragons, BTS, Metallica) are selected. It then collects the chosen names and displays them next to the question.
  • Function Write() takes the user’s written opinion about listening to music at school and displays it beside the question.
  • Function slider() reads how many hours per day the slider is set to and displays it along with the word “points.”
  • Function selectAnswer() checks whether the user has chosen “Yes” or “No” regarding listening to the radio and displays the choice. If nothing is selected, it asks the user to choose an answer.
  • Function selectStation() checks what is written in the radio stations field. If something is entered, it displays the selection; if empty, it shows “Select a station.”
  • Function selectGenre() shows which music genre the user selected from the dropdown. If nothing is selected, it says “Select a genre.”
  • Function clear() resets all answers and returns the form to its initial state.

In short, this code makes it so that when you answer the form, your response is immediately displayed next to the question. And when you click Clear, all answers disappear, and you can start again.

This is a description of the styles for the music questionnaire page.

  • The body has some padding around it and a light gray background.
  • The table takes the full width, but a maximum of 800 pixels, and has a light blue background.
  • Table cells have some padding inside and a bottom border.
  • The left column is wider (60%), with bold black text.
  • The right column is narrower (40%), with italic black text.
  • Buttons are centered below the table, with a blue background, white text, rounded corners, and the cursor changes on hover.
  • Checkboxes and radio buttons are slightly shifted to the right.
  • The text area takes the full width of the column and has a normal font size.
  • Dropdowns and input fields with suggestions also take the full width and have small padding.