Re: Hiding Options in Select
"John M. Hann" <[email protected]>
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hey Dave, If you just want to make the option item invisible in IE, set style="color: #fff; background-color: #fff;". Unfortunately, this leaves blank spaces in the list and does not prevent the users from selecting them. In IE, the SELECT and OPTION ignore just about all style attributes except color and background-color. I tried all of the following in IE6 and got nowhere: - filter: Alpha(opacity=0); width: 0px; /* element must have "layout" */ - width: 0px; - height: 0px; -- John http://e-numera.com/ --- In [email protected], "Gale, David" <David.Gale@H...> wrote: > > For a project, I need to have an option in a select, but which the user > can't see. (It's selectable through javascript, so I don't want to just > remove the option entirely). All examples I've seen online deal with > adding/removing options themselves, rather than showing and hiding them. > I can do this easily in FireFox, but I can't seem to in IE. > > Example: > <html> > <head><title>Test</title></head> > <body> > <select multiple="multiple"> > <option style="display:none">A</option> > <option>B</option> > <option style="visibility:hidden">C</option> > <option>D</option> > <option style="color:#f00">E</option> > <option>F</option> > <option>G</option> > </select> > </body> > </html> > > In Firefox, option A doesn't show up at all; there's a blank where > option C ought to be; and option E is red. In IE, however, options A > and C show up as normal. Option E still turns red, so I know options > can receive *some* stylings. > > Is it possible to do what I want, or so I need to code up a more complex > JavaScript solution? > > Thanks, > -David > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/9rHolB/TM --------------------------------------------------------------------~-> Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/