How to send a value to server from input fields html?

<label for="meal">Dish</label>
 <input type="text" list="item" id="meal" name="dish">
 <datalist id="item">
 <option value="fish">Fish</option>
 <option value="meat">Meat</option>
 <option value="eggs">Eggs</option>
 </datalist>


If you like "Meat" by pressing Enter is sent to the server as "Meat". How to make so that by pressing Enter On the server is sent a value of "meat"?
June 3rd 19 at 21:00
2 answers
June 3rd 19 at 21:02
Solution
Choose either of the Meat, and send it to the server. When you enter from the list nothing is selected. This list is only a pre-prepared options that you can use by selecting them with a click, no more. The rest of the processing should occur on the server.
June 3rd 19 at 21:04
Solution
Unfortunately, the datalist control is poorly implemented in modern browsers, its implementation is more like the first beta, the behavior differs from browser to browser. While we wait for the browser developers, you better use js-library for the implementation of such a field, for example, selectize.js.

Find more questions by tags HTML