Подскажите пожалуйста, почему не работает такой код в IE и Opera:
function criticality(form)
{
if(window.document.getElementById('CATEGORY_ID').value == 34)
{
window.document.getElementById('CRITICALITY_ID').options[2].style.display = 'block';
window.document.getElementById('CRITICALITY_ID').options[3].style.display = 'block';
}
else
{
window.document.getElementById('CRITICALITY_ID').options[2].style.display = 'none';
window.document.getElementById('CRITICALITY_ID').options[3].style.display = 'none';
}
}
<tr>
<td class="field-name">Категория:</td>
<td>
<select id="CATEGORY_ID" name="CATEGORY_ID" onchange="criticality(this.form)">
<option value="35">Консультация</option>
<option value="34">Ошибка</option>
<option value="36">Новое требование</option>
</select>
</td>
</tr>
<tr>
<td class="field-name">Критичность:</td>
<td>
<select id="CRITICALITY_ID" name="CRITICALITY_ID" onclick="criticality(this.form)">
<option value="4" style="display: block;">Низкая</option>
<option value="5" style="display: block;">Средняя</option>
<option value="6" style="display: block;">Высокая</option>
<option value="26" style="display: block;">Авария</option>
</select>
</td>
</tr>