3

I want to hide datalist value. Am using this code

<input list="options" oninput="console.log(this.value);" />
<datalist id="options">
  <option value="1">Product 1</option>
  <option value="2">Product 2</option>
  <option value="3">Product 3</option>
</datalist>

I mean in the inputbox this showing values and product 1 i need to show only product 1,2,&3...

hide value (1,2,3) enter image description here.

Note: Here am passing value 1,2,3 so i just want to hide that only

here my code https://jsfiddle.net/69u5Leoa/

Ramesh S
  • 841
  • 3
  • 15
  • 35

2 Answers2

0

You may want to use select, because for the select element, the user is required to select one of the options you've given.

For the datalist element, it is suggested that the user select one of the options you've given, but he can actually enter anything he wants in the input.

you can see this to get more information HTML Form: Select-Option vs Datalist-Option

<select id="options">
    <option></option>
    <option value="1">Product 1</option>
    <option value="2">Product 2</option>
    <option value="3">Product 3</option>
</select>
Community
  • 1
  • 1
Rex
  • 137
  • 2
  • 12
-3

Value="<%# DataBinder.Eval(Container, "ItemIndex") %>" it can solution this problem

ComEngTr
  • 20
  • 5