In a multi select, if you pick an item and scroll down so that the item is not visible, deleting the selected item will result in a blank entry in the select.
Here is an example.
<script type="text/javascript">
function remove() { theSelect = document.myForm.mySelect;
while (theSelect.selectedIndex > -1) { theSelect.remove(theSelect.selectedIndex); } }
Are you talking about after you remove all of the options?
That is what IE does, add a blank select like that and you can select the first blank.
Eric
Sophie Cameron
Greenhorn
Joined: Jun 05, 2005
Posts: 24
posted
0
No, I'm not talking about removing all of the options. I'm talking about removing ONLY ONE option.
Choose one option, scroll down so that it is not visible, and remove it. You'll see a blank option there.
That's not what is expected. The options array should have been compressed but actually not.
In the sample code, there are five options. After removing ONLY FIRST option following the steps, there are still five options there. The difference is that the first one is blank.
Thanks,
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
6
posted
0
What version of IE is this in? I am using IE6 and I have no problems
Eric
Sophie Cameron
Greenhorn
Joined: Jun 05, 2005
Posts: 24
posted
0
I'm also using IE6. To see the problem, you need to following the steps I provided. The point is that you have to scroll the select so that the selected option is NOT visible and then remove it by clicking the button.
It seems that the document needs reloading. I tried that but didn't help.
Does anybody have answers for this post? I repeated in IE6(sp2)( use onclick instead!!) but it works fine in FireFox.
I am afraid it's a bug of IE 6.0.
Thanks for reply.
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
6
posted
0
Could bring the value into view (select the item again) and then remove it. Simple if it was not a multiple select.
Eric
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
6
posted
0
AH, here
Eric
Jason Liao
Ranch Hand
Joined: Jun 17, 2005
Posts: 59
posted
0
Hi. Eric,
Thanks for your quick response, but the blank option is still there.
here are the steps to repeat (1) select "2" (2) scroll down untill you can not see it (3) click "remove" button (4) There is a black option between "1" and "3"
if you click the blank area, you get "3".(Duplcate "3"!).
It's Ok in feature but the blank is ugly. ( it does not appear in FireFox).