![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, all I would like to disable the dropdowm function on a SELECT element. I tried "disabled", it works but it becomes dim. I tried readonly, it won't work. I tried "onmousedown='return false' " , it won't work. Please advise how to disable it? Thank you very much! |
#3
| |||
| |||
|
|
"Jack" <jack2005 (AT) tpg (DOT) com.au> wrote in message news:438141b2$1 (AT) dnews (DOT) tpgi.com.au... Hi, all I would like to disable the dropdowm function on a SELECT element. I tried "disabled", it works but it becomes dim. I tried readonly, it won't work. I tried "onmousedown='return false' " , it won't work. Please advise how to disable it? Thank you very much! Why would you want to do that? The only function of a dropdown menu is dropping down, and you want to disable that? Then why have the control in the first place? What does it matter if it goes dim if you disable it? This is just so odd question... -- "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi? antaatulla.sikanautaa (AT) gmail (DOT) com.NOSPAM.invalid |
#4
| |||
| |||
|
|
Thank you for reply. I just want the Select element to work a readonly field. Jack |
#5
| |||
| |||
|
|
Thank you for reply. I just want the Select element to work a readonly field. |
#6
| |||
| |||
|
|
"Jack" <jack2005 (AT) tpg (DOT) com.au> wrote in message news:43816bd6$1 (AT) dnews (DOT) tpgi.com.au... Thank you for reply. I just want the Select element to work a readonly field. Okay... so why the select? Why not a readonly text input? Like so: <input type="text" readonly A select that user can't select serves no purpouse, if you ask me. I'd still like to hear a bit more of the situation, so that I might understund what you want. Well, I've heard _what_ you want, but I still don't know _why_ you want that... You obviously have a perfectly good reason. Since html4.01 specification does not define readonly for select element, the closest you can achieve is something like this: select name="select" onChange="this.selectedIndex=0;" option>one</option option>two</option /select The user may select something from the list, but js forces it to select 0 regardless of what user selected. Now, this again has no effect at all if I turn off javascript, so it has no significant value. Disabling the select is the fool-proof method, but apparently it's not what you wanted. -- "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi? antaatulla.sikanautaa (AT) gmail (DOT) com.NOSPAM.invalid |
#7
| |||
| |||
|
|
"Jack" <jack2005 (AT) tpg (DOT) com.au> wrote in message news:43816bd6$1 (AT) dnews (DOT) tpgi.com.au... Thank you for reply. I just want the Select element to work a readonly field. Okay... so why the select? Why not a readonly text input? Like so: <input type="text" readonly A select that user can't select serves no purpouse, if you ask me. I'd still like to hear a bit more of the situation, so that I might understund what you want. Well, I've heard _what_ you want, but I still don't know _why_ you want that... You obviously have a perfectly good reason. Since html4.01 specification does not define readonly for select element, the closest you can achieve is something like this: select name="select" onChange="this.selectedIndex=0;" option>one</option option>two</option /select The user may select something from the list, but js forces it to select 0 regardless of what user selected. Now, this again has no effect at all if I turn off javascript, so it has no significant value. Disabling the select is the fool-proof method, but apparently it's not what you wanted. -- "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirvi? antaatulla.sikanautaa (AT) gmail (DOT) com.NOSPAM.invalid |
![]() |
| Thread Tools | |
| Display Modes | |
| |