<option selected value ...> problem.

The following HTML generates a Drop Down List with a selected value that is (deliberately for the purpose of this question) outside the Drop Down List Window.
I have found that when viewing with IEXP V3.02 the option is selected AND the list is automatically scrolled so that it appears within the Drop Down List Window.
However when viewing with IEXP4.0 (4.72.2106.8) the option is selected but not displayed, you have to manually scroll down to see it.
I have experimented and it seems to be browser specific as it happens in both PWS and II3.
I want my application to be Browser independent so I need a way around this.
Incidentally I have some drop down lists that are generated from code and the same occurs.

Any help would be greatly appreciated.

<tr>
      <td width="50%"><strong><font color="#FF0000">What are you going to do?</font></strong></td>
      <td width="50%"><select name="ipWhatToDo" size="2">
        <option value="Delete This Item">Delete This Item</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option selected value="Edit These Details">Edit These Details</option>
      </select></td>
    </tr>

rogerb082098Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rafisternConnect With a Mentor Commented:
If you use size=1 (a drop down list as opposed to a scroll list) then the selected item will always come out on top. Maybe that is what you should do.
0
 
sybeCommented:
I checked in Netscape 3 & 4, neither one shows the selected options (as does IE 3 as you say). I haven't been able to check IE3.

I tried some javascript functions to set focus on the selected option, but nothing seems to work :(.

Maybe someone else knows.
0
 
BluemoonCommented:
It wont be possible to put the "edit these details" option on top?
the top one is always shown....
0
 
rogerb082098Author Commented:
Thanks for the answer buts its more of a workaround trhan a solution. Why does it work OK it IE3 but NOT in IE4?
20 points.
0
 
rafisternCommented:
The ways of Bill Gates (and his programmers) they be wonderous.. Need we say any more?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.