Jump to content
  • 0

Срочно! Как в ие сделать <option disabled>?


Константин
 Share

Question

Ие оказывается не поддерживает свойство disabled для option. Как исправить это. Слышал, что можно это сделать с помощью ява скриптов, но ява скрипт я не знаю, а сделать надо. Может кто-нибудь знает какой-нибудь скрипт для решения этой проблемы?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Если было все так просто. не работает. вот пример:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Тег SELECT, параметр disabled</title>
</head>

<body>

<form action="#">
<select>
<option selected>Выберите город</option>
<option value="t1">Казань</option>
<option value="t2">Москва</option>
<option value="t3" disabled="disabled">Питер</option>
<option value="t4">Зеленодольск</option>
</select>
</form>

</body>
</html>

везде работает, а в ие нет.

Link to comment
Share on other sites

  • 0
<html>
<head>
<title>Making a SELECT OPTION Disabled</title>
<script language="javascript">
function CheckForDisabled() {
// checks to see if the selected OPTION has a disabled attribute
if (document.frmTest.selDropDown.options[document.frmTest.selDropDown.selectedIndex].disabled) {

// Now reset the drop down list so that the first item is selected.
// If you didn't do this, the *disabled* item would still be selected
document.frmTest.selDropDown.selectedIndex = 0;
}
}
</script>
</head>
<body>

<form name="frmTest" action="" method="Post">
<select name="selDropDown" onchange="CheckForDisabled()">
<option value="1">123</option>
<option value="2">123 1</option>
<option value="3">123 2</option>
<option value="4">123 3</option>
<option value="5">123 4</option>
<option value="6">123 5</option>
<option value="7">123 6</option>
<option value="8" style="color=#a0a0a0;" disabled>i am disabled</option>
</select>
<input type="submit" value="submit">
</form>

</body>
</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy