Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent auto select first option of multiselect box in iPhone Safari

Tags:

html

ios

I have a problem with multiselect box on iPhone Safari. When I open the multiselect box it automatically selects the first option. Here is the code snippet that i am using:

<select multiple>
  <option value="test1">Test 1</option>
  <option value="test2">Test 2</option>
  <option value="test3">Test 3</option>
</select>

I have added a blank option with the disabled attribute (see below from here) as the first option but it didn't work in iPhone Safari. I am using an iPhone 6s+:

    <option disabled></option>
like image 935
Prince Gautam Avatar asked Mar 01 '16 13:03

Prince Gautam


1 Answers

disable=disable 

just add it in option so that no one will be able to access that option

like image 102
bhavik shah Avatar answered Sep 17 '22 13:09

bhavik shah