473,386 Members | 1,908 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,386 software developers and data experts.

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 31545
"john" <ne**@definitely.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="disabled">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.elements['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**@definitely.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="disabled">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.elements['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
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...
8
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...
1
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...
12
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...
0
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...
5
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...
3
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...
2
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 ...
10
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 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.