В ChildClass.methodTwo()
, можно звонить base.methodTwo()
.
За пределами класса, звоня ((ParentClass)a).methodTwo())
будет вызов ChildClass.methodTwo
. Это - вся причина, почему существуют виртуальные методы.
Установите этот флажок:
onclick="document.getElementById('IdOfTheTextbox').disabled=this.checked;"
<input type="text" id="textBox">
<input type="checkbox" id="checkBox" onclick="enableDisable(this.checked, 'textBox')">
<script language="javascript">
function enableDisable(bEnable, textBoxID)
{
document.getElementById(textBoxID).disabled = !bEnable
}
</script>
Использование jQuery:
$("#checkbox").click(function(){
$("#textbox")[0].disabled = $(this).is(":checked");
});