views:

17

answers:

2

Hi,

I am showing Category and Sub category in a drop down box and i dont want the drop down value of the main category to be selected by any user.

so i applied disable="disabled" and it works fine in firefox, chrome, and also IE8, but it is not working in IE6 and IE7

any solution

my code:

<option value="test" disabled="disabled" >Test></option>

thanks in advance

deve

+1  A: 

It seems this is a well documented problem with IE6/IE7.

A quick Google search revealed this potential workaround: http://www.goodercode.com/wp/disable-select-options-internet-explorer-jquery/

clifgriffin
A: 

I don't think you can achive this in IE. What you can do is to use a little javascript to tell the user that the option is disabled:

function check(el) {
  if (el.options[el.selectedIndex].disabled) {
     alert ("This option is not available!")
     el.options.value = '';
  }
}

Also check this solution: http://www.lattimore.id.au/2005/07/01/select-option-disabled-and-the-javascript-solution/

Parkyprg