473,799 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to hide a option in select

254 Contributor
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 44333
ThatThatGuy
449 Recognized Expert Contributor
<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 Contributor
@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
5257
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 radio option, like so: Choice: (Radio1) type: (select box1) Choice: (Radio1) type: (select box2) Choice: (Radio1) type: (select box3) Choice: (Radio1) type: (select box4) Choice: (Radio1) type: (select box5)
1
2794
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'); In other words, which W3C document standardizes the "new Option" interface? Or does this fall into the category of the mythical "DOM 0" interface, documented nowhere but implemented everywhere?
2
2105
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 problem is I have a variable called Item_Start, that contains a time that is determined from another procedure. I simply wish to auto select the option if it is found. This all happens when the page loads. You can see below I tried, but it failed. How...
19
6934
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 JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
1
2950
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 be on a drop-down box (Option Select). Beneath this I've set a textarea and I wanted this to be populated with the answer based on the user selection. I've created an array of my answers in the header area and tried to get an ONCHANGE on the...
3
12533
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 standing next to it. If i do print_r ($folders); then the folders are side by side and the array has only index. Anybody an idea? this is my script: <? echo "<select name=\"selecteer folder\" size=\"1\" >"; $dir = ".";
3
6758
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 the user can select a value or enter one in the same place... CSS? TIA,
2
3340
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 has to open the drop down list again. I just wondered if there was a way using javascript to firstly detect if the user has selected the drop down list and if so, on refresh to set that drop down list to stay dropped down?
10
7422
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 field display not display degree text field ->when user select other value in the selection field for degree then text field display and wise versa //// <bodly> <table>
0
10475
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10222
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.