Survey Form - Build a Survey Form

Hello,
I need help in this part of the task:

(You should have a select field with an id of dropdown)

felipebcristino,

Since this is a certification project I’m not sure how much they allow us to assist, so I’m not going to post actual code. If you go back to the Registration Form exercise, scroll down to the input labeled “How did you hear about us?”…that functionality is what they’re requiring you to include. Click HERE for a great tutorial just on this element. Also, if it will help, below are some notes I took on that step of the exercise. Hope some of it helps!

SELECT element: Drop-down list

Adding a drop-down list to a form is accomplished with the select element. This element is a container for a group of option elements, and the option element acts as a label for each drop-down option. Both elements require closing tags.

Submitting the form with an option selected but with no value would not send a useful value to the server. As such, each option needs to be given a value attribute. Without that, the text content of the option will be submitted to the server.

  • The placeholder is NOT used as the ‘clue’ inside the input. If you desire placeholder functionality inside the drop-down list, (e.g. “please select one”), then the first option is setup as the placeholder:
    • The first option should have no value inside the “”
    • The first option should have two additional attributes: SELECTED and DISABLED
    • The SELECTED attribute makes the first option initially visible, much like a placeholder; the DISABLED attribute makes it impossible to select from the list.
1 Like