473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

make certain values in select box greyed out and unselectable?

I'm looking to have a form where a drop down list contains my full range of
options even when some are not currently available. Is it possible to
produce a select box where some items could show differently (eg greyed out)
and not be selectable?

All suggestions welcome!!

Thanks

John
Jul 20 '05 #1
2 31607
"john" <ne**@definitel y.no-spam.org.uk> writes:
I'm looking to have a form where a drop down list contains my full range of
options even when some are not currently available. Is it possible to
produce a select box where some items could show differently (eg greyed out)
and not be selectable?


<select>
<option>Yes</option>
<option disabled="disab led">No</option>
</select>

Since you are asking in a javascript group, I assume you need to
change the disabled state of an option dynamically:

formRef.element s['mySelect'].options[1].disabled=true;

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Thanks Lasse - I'd no idea this was a standard select box feature (Doh!),

John

Lasse Reichstein Nielsen <lr*@hotpop.com > wrote in message news:<br******* ***@hotpop.com> ...
"john" <ne**@definitel y.no-spam.org.uk> writes:
I'm looking to have a form where a drop down list contains my full range of
options even when some are not currently available. Is it possible to
produce a select box where some items could show differently (eg greyed out)
and not be selectable?


<select>
<option>Yes</option>
<option disabled="disab led">No</option>
</select>

Since you are asking in a javascript group, I assume you need to
change the disabled state of an option dynamically:

formRef.element s['mySelect'].options[1].disabled=true;

/L

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1859
by: jazpar | last post by:
Could anyone help med with a select statement with a join between to tables. It is to be used in a OLAP cube. I Havde table LedgerBudget and Table Admin. In table admin I can setup a from and to date and also a budgetmodel. The admin have ONE record per OLAP cube. The statement below works fine if I have stated a budgetmodel in table Admin. But if no budetmodel stated in table Admin, I want the statement to select every ledgerbudget...
8
2844
by: Fabian Braennstroem | last post by:
Hi, I would like to remove certain lines from a log files. I had some sed/awk scripts for this, but now, I want to use python with its re module for this task. Actually, I have two different log files. The first file looks like: ...
1
1648
by: atiq | last post by:
I am trying to count the total postive and negative behaviour incident. the name of the field is Category which is a combo box and has the values Minor, Major and Postive (these are the behaviour types. i want the query to count the total number of Postive and negative (this is Minor and Major) for the given results. So, in simple words the actual select query finds the total incidents reported for a particular year group. from these...
12
2890
by: tadisaus2 | last post by:
Hello, Checkbox form validation - how to make a user select 4 check boxes? I have a question of a few checkboxes and how do I require a user to check 2 checkboxes (no more, no less)? Here is my form: <input type="checkbox" name="color" id="q" value="a" />A<BR /> <input type="checkbox" name="color" id="q2" value="b" />b<BR /> <input type="checkbox" name="color" id="q3" value="c" />c<BR /> <input type="checkbox" name="color" id="q4"...
0
1274
Gyanchand
by: Gyanchand | last post by:
Need to generate a word document using a template in ASP by inserting certain values at runtime. Can sum1 plz. help me figure out how can you write to a word file... tried using Response.ContentType = "application/msword" but it allows the user the to save the file at any desired location. That is not what I want. I want to save the file on the server under a particular folder.....
5
14281
by: Ashutosh | last post by:
Hi, I have a DataGridView which has as typed data-set associated with it. For the table which I am displaying in it, I want to display certain cells (corresponding to a column in the database) to be displayed as blank instead of the value 0 (Zero - integer). Also, I want the value 0 (zero) to be saved to the database when the changes are applied/saved and if the cells are blank. I tried to change the text that is drawn/shown in the grid...
3
4924
by: hedges98 | last post by:
Right, I have two combo boxes - let's call them cboStatus and cboResolutionDate Basically, what I want to happen, is when a user selects a certain option from cboStatus and cboResolutionDate is blank, a message will pop up and inform the user that they need to enter a resolution date. I can quite happily make a message box pop up when a user selects the appropriate status but can't figure out how to combine this with cboResolutionDate...
2
1738
by: Ken Jones | last post by:
Table URL_3 consist of the following 2 columns of information being Record No and URL No URL 1 http:/publishing/45/100006_f.SAL_Local.html 2 http:/publishing/45/100006_f.SAL_Area.html I need a substring query that will return the values of Local and Area from column URL of Table URL_3 into an additional column of information. I was looking for the solution, shown below, that tried to delimit the desired...
10
6757
TheSmileyCoder
by: TheSmileyCoder | last post by:
I have a combobox linked by SQL to a table. The table has standard Primary Key (Autonumber) and text field. There are 3 records: KEY_DocType tx_DocType 1 RMT Document 2 Review Document 3 Reference Document
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
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
10317
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,...
1
7615
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
6851
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
5520
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...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
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.