0

Firefox doesn't show form correctly (Chrome and IE show same form without any problem).

In Firefox in first line in form text value doesn't appear.

In Firefox Firebug shows:

<td>
  <select id="refSearchType" size="10" name="refSearchType">
  <option selected="true" label="Option1" value="Option1"></option>
  <option value="Option2">Option2</option>
  <option value="Option3">Option3</option>
</select>

In IE View Source shows:

<td>
<select id="refSearchType" name="refSearchType" size="10">         
     <option value="Option1" label="Option1" selected="selected" />
     <option value="Option2">Option2</option>
     <option value="Option3">Option3</option>
    </select>
</td>

My jsp code:

<td>
   <form:select path="refSearchType" size = "10">         
     <option value="${first}" label="${first}" selected="selected"/>
     <form:options items="${searchList}" />       
    </form:select>
 </td>

I tried to switch value of selected= to "true" or "yes" , doesn't work

CTRL+F5 doesn't work too

Please advice

Thank you in advance

Toren
  • 6,648
  • 12
  • 41
  • 62
  • This could be to do with Firefox's autocomplete feature. See http://stackoverflow.com/questions/4831848/firefox-ignores-option-selected-selected – Will Keeling May 22 '13 at 11:00

2 Answers2

0

I fixed the problem by adding ${first} in line of option value

 <td>
  <form:select path="refSearchType" size = "10">         
  <option value="${first}" label="${first}" selected="selected">${first}</selected>
  <form:options items="${searchList}" />       
  </form:select>
</td>
Toren
  • 6,648
  • 12
  • 41
  • 62
0

This is a bug in Firefox. They don't seem to care, since this has been around since pre-HTML 2.0

https://bugzilla.mozilla.org/show_bug.cgi?id=option-label

Chris Fremgen
  • 4,649
  • 1
  • 26
  • 26