---
title: "låsning av select lista?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/javascript/17104-låsning-av-select-lista"
topic: "JavaScript"
topic_url: "https://www.webforum.nu/amne/javascript"
author: "clown"
published: "2000-09-19T07:28:00.000Z"
updated: "2000-09-21T06:00:00.000Z"
replies: 6
views: 269
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/javascript/17104-låsning-av-select-lista"
---

# låsning av select lista?

## #1 — clown, 2000-09-19T07:28Z

Hej
Jag undrar hur man skulle göra om man har en select lista som man ibland INTE skall kunna välja något från.
Så hur 'låsre' man en select lista så att det inte går att välja från den??

Permalänk: https://www.webforum.nu/p/17104

## #2 — toha, 2000-09-19T12:31Z

\<select name="hej" **disabled**\>
  ...
\</select\>

eller med skript:

document.forms\[0\].hej.disabled = true;

Permalänk: https://www.webforum.nu/p/327598

## #3 — clown, 2000-09-20T15:39Z

Ahhaa....

Men funkar detta i både NS och IE ??
För i netscapes javascript ref fanns inte denna med!

Permalänk: https://www.webforum.nu/p/327599

## #4 — @nders, 2000-09-20T15:42Z

disabled, är så vitt jag vet, ett ie-only attribut.

men det är väl inte så svårt att testa om det funkar i netscape :q

Permalänk: https://www.webforum.nu/p/327600

## #5 — RGB, 2000-09-20T16:49Z

Det är en del av DOM Level1 HTML:

**Object HTMLSelectElement** 

**HTMLSelectElement** has the all the properties and methods of HTMLElement as well as the properties and methods defined below. 

The **HTMLSelectElement** object has the following properties: 

**type** 
This property is of type String. 

**selectedIndex** 
This property is of type long. 

**value** 
This property is of type String. 

**length** 
This property is of type long.

**form** 
This property is of type HTMLFormElement. 

**options** 
This property is of type HTMLCollection. 

**disabled** 
This property is of type boolean. 

**multiple** 
This property is of type boolean. 

**name** 
This property is of type String. 

**size** 
This property is of type long. 

**tabIndex** 
This property is of type long. 

The HTMLSelectElement object has the following methods: 

**add(element, before)** 
This method returns a void. The element parameter is of type HTMLElement. The before parameter is of type HTMLElement. 

**remove(index)** 
This method returns a void. The index parameter is of type long. 

**blur()** 
This method returns a void. 

**focus()** 
This method returns a void. 

Saxat från: 
<http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html>

Permalänk: https://www.webforum.nu/p/327601

## #6 — toha, 2000-09-20T19:07Z

Snyggt R.G.B!

Dessvärre så är det inte säkert att IE och NN stöder allt det som står i DOM-specifikationen. :( Men disabled fungerar bra både i IE och NN.

Permalänk: https://www.webforum.nu/p/327602

## #7 — clown, 2000-09-21T06:00Z

Jag tackar och bugar för den eminenta hjälp man har fått och kan få av dessa underbara, upplysta personer som hangs around på detta forum ;)

/Jonas

Permalänk: https://www.webforum.nu/p/327603

---

Tråden på webben: https://www.webforum.nu/amne/javascript/17104-låsning-av-select-lista
