3

The GitHub page shows how to add additional fields as input fields or checkboxes. But I can't figure out how to add drop-down fields. Is this possible?

<select>
  <option value="——" selected="selected">Please select...</option>
  <option name="message[model][]" value="volvo">Volvo</option>
  <option name="message[model][]" value="saab">Saab</option>
  <option name="message[model][]" value="mercedes">Mercedes</option>
  <option name="message[model][]" value="audi">Audi</option>
</select>

Thanks!

6

It's definitely possible, your HTML is just a little off...

When dealing with a dropdown menu, the name attribute should be part of the select tag, not each individual option:

<select name="message[model]">
  <option value="——" selected="selected">Please select...</option>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.