Select multiple

1

I'm having a problem getting the results of a select multiple, as it does not come with any name when it comes to an example compound name.

<form action="/action_page.php">
<select name="cars" multiple>
  <option value="volvo">Volvo teste</option>
  <option value="saab">Saab verifica</option>
  <option value="opel">Opel mais</option>
  <option value="audi">Audi</option>
</select>
<input type="submit">
</form>

But when I get the return response it only appears:

"Volvo", "Saab", "Opel" e "Audi"

The compound part of the name is not appearing. It was to appear in my result if I select "Volvo Test" and not just "Volvo".

    
asked by anonymous 12.09.2018 / 21:07

2 answers

0

When you send select you do not get your name , only the value property of the selected options as sam mentioned in the comment.

See you soon and welcome to Stack Overflow BR

    
12.09.2018 / 21:25
0

I put the full name in your value attribute of Html because this attribute is responsible for the return and not what you wrote for the page view. For sure what is returning to you in this code above is what is written within value .

<form action="/action_page.php">
  <select name="cars" multiple>
    <option value="Volvo teste">Volvo teste</option>
    <option value="Saab verifica">Saab verifica</option>
    <option value="Opel mais">Opel mais</option>
    <option value="Audi">Audi</option>
  </select>
  <input type="submit">
</form>

I hope I have helped!

    
12.09.2018 / 21:44