474,003 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling parts of a select

Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.

Thanks,

-- tim
Jan 31 '07 #1
11 1710
Tim Streater wrote:
>
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.
According to MSDN HTML reference, for the "disabled" attribute/property:
"...For OPTGROUP and OPTION, the functionality specified by the HTML
4.0 standard is not currently implemented..."
Jan 31 '07 #2
In article <45************ ***@thelogconne ction.com>,
Gary Hasler <ga********@the logconnection.c omwrote:
Tim Streater wrote:

Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.

According to MSDN HTML reference, for the "disabled" attribute/property:
"...For OPTGROUP and OPTION, the functionality specified by the HTML
4.0 standard is not currently implemented..."
Thanks. Guess I'll have to leave those items out of the popup then.
Shame, it would have been useful for them to be there, but dimmed and
unselectable.

-- tim
Feb 1 '07 #3
* Tim Streater wrote:
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.
If you don't want them to be selectable don't put them in a select box.
You could have two select boxes one showing selected items one showing
unselected items. Then a button to copy from one select to the other
(add/remove) Seem familiar? :-D It's trivial to do in JavaScript.
Feb 1 '07 #4
In article <ep**********@c ustnews.inweb.c o.uk>,
John Smith <jo*********@zx lj1.comwrote:
* Tim Streater wrote:
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.

If you don't want them to be selectable don't put them in a select box.
You could have two select boxes one showing selected items one showing
unselected items. Then a button to copy from one select to the other
(add/remove) Seem familiar? :-D It's trivial to do in JavaScript.
Hmm this is waht happens when one posts with no context. The user of the
select might wonder why the option they want doesn't appear in the
select. The reason will be because they didn't enter an item in the
database correctly, elsewhere. I want the item to be visible but not
selectable. Then I can have a note saying telling them why this is. Its
a visual clue to the user.

-- tim
Feb 1 '07 #5
"Tim Streater" <ti**********@d ante.org.ukwrot e in message
news:ti******** *************** *********@indiv idual.net...
In article <ep**********@c ustnews.inweb.c o.uk>,
John Smith <jo*********@zx lj1.comwrote:
>* Tim Streater wrote:
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.

If you don't want them to be selectable don't put them in a select box.
You could have two select boxes one showing selected items one showing
unselected items. Then a button to copy from one select to the other
(add/remove) Seem familiar? :-D It's trivial to do in JavaScript.

Hmm this is waht happens when one posts with no context. The user of the
select might wonder why the option they want doesn't appear in the
select. The reason will be because they didn't enter an item in the
database correctly, elsewhere. I want the item to be visible but not
selectable. Then I can have a note saying telling them why this is. Its
a visual clue to the user.
So use JavaScript to write out your selects and then populate some list with disabled
options with your reasons stated near it.

-Lost
Feb 1 '07 #6
Tim Streater wrote:
>
In article <ep**********@c ustnews.inweb.c o.uk>,
John Smith <jo*********@zx lj1.comwrote:
* Tim Streater wrote:
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?
>
I think this is the case but would like to be sure.
If you don't want them to be selectable don't put them in a select box.
You could have two select boxes one showing selected items one showing
unselected items. Then a button to copy from one select to the other
(add/remove) Seem familiar? :-D It's trivial to do in JavaScript.

Hmm this is waht happens when one posts with no context. The user of the
select might wonder why the option they want doesn't appear in the
select. The reason will be because they didn't enter an item in the
database correctly, elsewhere. I want the item to be visible but not
selectable. Then I can have a note saying telling them why this is. Its
a visual clue to the user.

-- tim
You know, now that I think about it, I have seen popup lists where some
options are either disabled, or in a different color, or had a different
background...ca n't remember where or when or how it was done. If you
could at least give them a different color or font weight--maybe using
styles--then if they choose one of the invalid options you could pop up
a warning that they have to change it?...
Feb 1 '07 #7
"Gary Hasler" <ga********@the logconnection.c omwrote in message
news:45******** *******@thelogc onnection.com.. .
Tim Streater wrote:
>>
In article <ep**********@c ustnews.inweb.c o.uk>,
John Smith <jo*********@zx lj1.comwrote:
* Tim Streater wrote:
Am I right in thinking that while I can disable a select, I can't
disable the <option>s within the select?

I think this is the case but would like to be sure.

If you don't want them to be selectable don't put them in a select box.
You could have two select boxes one showing selected items one showing
unselected items. Then a button to copy from one select to the other
(add/remove) Seem familiar? :-D It's trivial to do in JavaScript.

Hmm this is waht happens when one posts with no context. The user of the
select might wonder why the option they want doesn't appear in the
select. The reason will be because they didn't enter an item in the
database correctly, elsewhere. I want the item to be visible but not
selectable. Then I can have a note saying telling them why this is. Its
a visual clue to the user.

-- tim

You know, now that I think about it, I have seen popup lists where some
options are either disabled, or in a different color, or had a different
background...ca n't remember where or when or how it was done. If you
could at least give them a different color or font weight--maybe using
styles--then if they choose one of the invalid options you could pop up
a warning that they have to change it?...
http://www.lattimore.id.au/2005/06/1...pdown-element/

Of course, do not expect Internet Explorer to play along. As stated in the article, "the
IE team" implemented the "disabled" attribute for the select itself, but not its options.

You can visit the first link on that page which gives Internet Explorer a JavaScript
alternative. It "fakes" it rather nicely by switching your choice if you choose one of
its grayed options.

-Lost
Feb 2 '07 #8
Gary Hasler wrote:
>
...snip..
>
You know, now that I think about it, I have seen popup lists where some
options are either disabled, or in a different color, or had a different
background...ca n't remember where or when or how it was done. If you
could at least give them a different color or font weight--maybe using
styles--then if they choose one of the invalid options you could pop up
a warning that they have to change it?...
Hey it works; at least in IE6. Create a style, eg:
<style type="text/css">
option.forbid { color: #888; }
</style>

then have your script write the "disabled" options as:
<OPTION value='foo' class="forbid" >

They can still choose them, but you can handle that however you think
best.
Feb 2 '07 #9
On Feb 1, 4:49 pm, Gary Hasler <garyhas...@the logconnection.c om>
wrote:
Gary Hasler wrote:

..snip..
You know, now that I think about it, I have seen popup lists where some
options are either disabled, or in a different color, or had a different
background...ca n't remember where or when or how it was done. If you
could at least give them a different color or font weight--maybe using
styles--then if they choose one of the invalid options you could pop up
a warning that they have to change it?...

Hey it works; at least in IE6. Create a style, eg:
<style type="text/css">
option.forbid { color: #888; }
</style>

then have your script write the "disabled" options as:
<OPTION value='foo' class="forbid" >

They can still choose them, but you can handle that however you think
best.
This is certainly a hack, but you can use the optgroup html element:
<optgroup label="not selectable"></optgroup>

Feb 2 '07 #10

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

Similar topics

4
2621
by: Old Lady | last post by:
Hi, I need help! I have a SELECT/OPTION list. My goal is to have a TEXT input field in a form that is normally disabled, but it should become enabled when the user select one predefined OPTION. If the user change idea and select another OPTION, the TEXT input field should be disabled again. I hope I'm understandable. Sorry for my bad English.
12
2303
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation errors show up in your error-list, you can disable this functionality by selecting the Tools->Options menu item in VS or Visual Web Developer. Select the TextEditor->Html->Validation tree option in the left-hand side of the
1
2826
by: kebabkongen | last post by:
Hi, I'm working on a JavaScript that is enabling / disabling a select element according to whether a checkbox is selected or not. This works fine in Firefox, but in Internet Explorer (v 6.0.2900) it appears wierd: When I disable the selevt element in IE, it continues to appear as enabled (falsely) until I try changing it. When I click on it, updates itself as grey as to indicate that it is disabled.
3
1566
by: Rick | last post by:
I have a customer order form with a subform that lists parts per customer order that I'm updating. I'm trying to filer the parts list per Manufacture and Model number so that the user doesn't have to scroll through the complete list of parts to find the parts that relate to the model in question. I've got two combo boxes on the main form where you can select the manufacture, that filters the model combo box to show only models from that...
0
1536
by: Hvid Hat | last post by:
Hi At first, I thought I could only solve my problem with a C# method inside my XSLT but I'm beginning to think it might be possible with XSLT only. So I'm trying, but I need help :-) How can I split a grouping into 3 parts? I've got the following grouping of countries which is working fine: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
92
4835
by: bonneylake | last post by:
Hey Everyone, Well i was hoping someone could explain the best way i could go about this. i have a few ideas on how i could go about this but i am just not sure if it would work. Right now i have a form where you can add and delete multiple serial information. This works wonderful. But now for every serial information i add i need to be able to add and remove multiple parts to that serial. heres an example of what i mean serial...
58
8189
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also the parts section an i seem to be having trouble. When i try to insert into the parts section i get the error Invalid character value for cast specification. But not sure what i am doing wrong. Here is what i am using to insert. All the sections...
1
1419
by: thesti | last post by:
hello, i need to validate birthday using javascript. the validation is that for example user couldn't choose the date 29, 30 and 31 if she has chosen February as the month before and the year % 4 isn't 0. i've done this with disabling the 29, 30 and 31 options in the select widget. here's the example code document.register.birthday.options.disabled = true; it works fine with Opera9.6 and firefox3.0.4 but, when i try it with IE6, the...
0
10440
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
10254
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
11975
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...
0
11515
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8581
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
7731
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
6541
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
4850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3878
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.