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,009
  • 1
  • 12
  • 17
3

Selected attribute only contain selected value, like this:

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

Would be the correct way to do it, AFAIK.

d-_-b
  • 6,265
  • 5
  • 37
  • 57
0

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

Sufendy
  • 1,196
  • 2
  • 15
  • 29