Re: Re: Hiding Options in Select

Ryan Hicks <[email protected]>
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
Hi David,
  Could you possibly use a hidden field to pass the data on to the server,
rather than the select list? Keep the select list as your interface, but
when the user selects one of those items, populate the hidden field with the
selected value. If an option should be invisible, simply remove it from the
select. Then, when you need to programatically select an unshown option,
just put that value into the hidden field.
  Just a quick thought that may have no bearing on your actual problem..
 --
Ryan Hicks

 On 11/18/05, John M. Hann <[email protected]> wrote:
>
> 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
> >
>
>
>
>
>
>
>
> Unsubscribe
> [email protected]
>
> List info
> http://www.quirksmode.org/dom/list.html
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.