1

I am trying to preselect like this:

<option selected="yes" value="test1" >test1</option

But I get a message in VS2010 saying "Validation HTML5: The value permitted for this attribute do not include 'yes'.

Am I doing something wrong. I thought the way to preselect was as above.

Hiroki
  • 47
  • 2
  • 5

4 Answers4

4

it should be selected="selected"

<option selected="selected" value="test1" >test1</option>
Dharmesh
  • 1,039
  • 1
  • 12
  • 17
3

Selected attribute only contain selected value, like this:

<option selected="selected" value="test1">test1</option>
DStereo
  • 251
  • 3
  • 4
2
<option selected="selected">test1</option>

Would be the correct way to do it, AFAIK.

d-_-b
  • 6,555
  • 5
  • 40
  • 58
0

try selected="selected" or you can just leave the selected without any value like <option selected>test1</option>

Sufendy
  • 1,212
  • 2
  • 16
  • 29