473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

filter on items in select (ie6 bug?/hidden feature?)

Hi.
I'm have a page thas shows a list of items and a text input box. The
text input box works as a filter and the javascript hides the elements
that do not contain the String from the input box.
In firefox this works perfect.. in IE6 I can't get it working, anybody
an idea?

source:

<html>
<body>
<script>
function filter(obj){
var veld = document.getElementById('list');
var str=obj.value;
for (var loop= (veld.options.length-1) ; loop >= 0; loop--){
if (veld.options[loop].text.search(str) == -1){
veld.options[loop].style.display = 'none';
}
else{
veld.options[loop].style.display = '';
}
}
}
</script>
<input type="text" onkeyup="filter(this)"/>
<select multiple="multiple" class="swapfield" size="10" name="list"
id="list">
<option value="1">Wout Netjes</option>
<option value="2">Trudi Netjes</option>
<option value="3">jeroen Bos</option>
<option value="4">Marietje Bos</option>
</select>
</body>
</html>

Aug 17 '06 #1
1 1758
Oskar wrote:
I'm have a page thas shows a list of items ... hides the
elements that ... .
In firefox this works perfect.. in IE6 I can't get it
working, anybody an idea?
<snip>
veld.options[loop].style.display = 'none';
<snip>

IE does not support CSS styles applied to individual OPTION elements. IF
you want them not to be shown to the user you must remove them form the
SELECT element's options collection (and re-instate them to return them
to visibility).

Richard.
Aug 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
4
by: fidodido | last post by:
If i press the button "MOVE UP", it will go to the top of the select box. If i press the button "MOVE DOWN", it will go to the bottom of the select box. The selected values that the user select...
5
by: dkelly925 | last post by:
Is there a way to add an If Statement to the following code so if data in a field equals "x" it will launch one report and if it equals "y" it would open another report. Anyone know how to modify...
5
by: Nick Weisser | last post by:
Hi there, I'm not sure how to select the last 3 items in ascending order. This does the trick in descending order: select * from user_menu_main where deleted = 0 and hidden = 0 order by...
11
by: jason.teen | last post by:
Hi, I dont seem to be able to get this Filter right on my RecordSet for some reason. I have this code: Dim rs As Recordset Set rs = CurrentDb().OpenRecordset("SELECT DISTINCT Product,
4
by: Fran | last post by:
I recently tried to use code for "Use a multi-select list box to filter a report" from Allen Browne in my database. I was able to add the code and adapt it to my needs, however I am getting an...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.