Click to See Complete Forum and Search --> : Can I hide <option> elements?


Jeremy Davis
February 7th, 2003, 10:10 AM
I have a <select> list with loads of <option> elements. I would like to provide an edit box that when typed into reduces the number of <option> elements to matching ones only.

I wish to use JavaScript only, and I relaise I could use a large array, match the array, emply the <select> list, and re-populate using the matches. however there are so many <option> elements that I'd rather not create an array as this would slow the page download speed.

Perhaps is there any way I can make an <option> element invisible? Can anyone think of a better way please? Thanks. :)

antares686
February 10th, 2003, 05:41 PM
To the best of my knowledge and experience I have not seen a way to hide an Option element. It does not support that style.

I cannot right now think of another option but will post if I can think of any. Might try using XML as a datasource and work with it as a dataobject but not sure what offhand would be the approach.