dolbex — 2006-11-09T12:57:50-05:00 — #1
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.
Here is the output from my code
<select name='name'><option value='1'>xxx</option>
<option value='3' selected>ccc</option>
dan_grossman — 2006-11-09T13:01:09-05:00 — #2
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.
php_daemon — 2006-11-09T13:02:12-05:00 — #3
<option value="x" selected="selected">nnn</option>
dan_grossman — 2006-11-09T13:06:18-05:00 — #4
Firefox is perfectly capable of interpreting HTML 4, where "selected" alone indicates the selected option.
viveknarula — 2006-11-09T13:49:20-05:00 — #5
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'.
dolbex — 2006-11-09T14:03:33-05:00 — #6
Right on. slaps forehead