473,398 Members | 2,403 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,398 software developers and data experts.

how to hide a option in select

254 100+
Hello

I need to hide a particular option value using css based on a condition but when try to use style for that particular option nothing happen. How can I do it?

Expand|Select|Wrap|Line Numbers
  1. <select name="select" class="aa">
  2.   <option value="m" selected="selected">mukesh</option>
  3.   <option value="k" style="display:none;">kumar</option>
  4.   <option value="mi">mishra</option>
  5. </select>
  6.  
May 18 '10 #1
2 44225
ThatThatGuy
449 Expert 256MB
<option value="k" style="display:none;">kumar</option>
this code works... it really hides the element

try checking it again
May 19 '10 #2
mukeshrasm
254 100+
@ThatThatGuy
this works only in firefox but in ie8 and I want to work in ie8 as well.
May 20 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
1
by: Joe Kelsey | last post by:
I cannot find references to the use of code like the following anywhere in the W3C DOM: var select = document.getElementById ('myselect'); select.options = new Option ('string', 'string'); ...
2
by: Eric Tuomikoski | last post by:
Im having trouble with server side ASP with Javascript. I have an ADO recordset that returns a list of Times example: 7:00AM. I then populate the option box with the results. (see below) The...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
1
by: Benaron | last post by:
I'm a javascript newbie - so although I can follow scripts and write simple ones, I get stuck when things don't work. I'm trying to have a help section on my web-site where each question/FAQ will...
3
by: djpaul | last post by:
Hello guys, I'm busy with an photogallery and i wanted to implent this script i wrote to select a folder and put there the photo's in. But i only get 1 folder in the drop-down menu and the other is...
3
by: do.uris | last post by:
Hi List, I wonder if it's possible to have a "input text form field" behaving like a value list, "select option". I don't want two fields, I want to have a "select option" with a input field so...
2
by: crazychrisy54 | last post by:
Hi there I have a option, select drop down list which a user can open. My page however refreshes very frequently and when this occurs the selected drop down list will pop back up. The user then...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.