Dynamic Select - "Selected" not working in Firefox

Sorry if this should be in HTML, but I think it may be a PHP problem. For some reason when I generate dynamic option listings “<option value=“x” selected>” does not work. By “not work” I mean that the combo box does not select that option by default on the form. It does work in IE6 but not FF.

Any clues?

Here is the output from my code

	<select name='name'><option value='1'>xxx</option>
<option value='2'>bbb</option>
<option value='3' selected>ccc</option>
<option value='4'>ddd</option>

<option value='5'>eee</option>
<option value='6'>fff</option>
<option value='7'>ggg</option>
<option value='8'>hhh</option>
<option value='9'>iii</option>
<option value='10'>jjj</option>
	</select>

The above code does work in Firefox. ‘ccc’ is selected by default.

If you made your own selection, refreshing/going back will keep the selection you made (just like what you typed into text inputs is still typed when you go back).

Clear your cache, close your browser, go back to your test page and you should see that ‘ccc’ is selected.

Try

<option value="x" selected="selected">nnn</option>

Firefox is perfectly capable of interpreting HTML 4, where “selected” alone indicates the selected option.

I would like to suggest u to TRY what “php_daemon” is suggesting as i faced same problem i solve it by putting selected=‘selected’.

Right on. slaps forehead