IE, disabling options in <select>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thesti
    New Member
    • Nov 2007
    • 144

    IE, disabling options in <select>

    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

    Code:
    document.register.birthday.options[31].disabled = true;
    it works fine with Opera9.6 and firefox3.0.4 but, when i try it with IE6, the script doesn't work.

    how to achieve this in IE, or is there any workaround for this for IE?

    Thank you,
    SC
  • Logician
    New Member
    • Feb 2007
    • 210

    #2
    I.E doesn't support disabling of options.
    You could use the onchange handler to limit the selectedIndex to 28 on the appropriate month.

    Comment

    Working...