This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > November 2006 > select-option style change in javascript





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author select-option style change in javascript
aamirghanchi@yahoo.com

2006-11-05, 11:33 pm

I guess, the visibility and display styles of an OPTION in a SELECT
list cannot be changed through javascript. I wanted to make some
options unavailable depending on a situation
eg.
<select>
<option id="optID" value="Opt1">Option 1</option>
</select>

document.getElementById("optID").style.visibility = 'hidden';
document.getElementById("optID").style.display = 'none';

this not working.

Any ideas are very welcome.

Harlan Messinger

2006-11-05, 11:33 pm

aamirghanchi@yahoo.com wrote:
> I guess, the visibility and display styles of an OPTION in a SELECT
> list cannot be changed through javascript. I wanted to make some
> options unavailable depending on a situation
> eg.
> <select>
> <option id="optID" value="Opt1">Option 1</option>
> </select>
>
> document.getElementById("optID").style.visibility = 'hidden';
> document.getElementById("optID").style.display = 'none';
>
> this not working.


In IE it doesn't even work if you set these in the CSS.

In Firefox, it works fine.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews