I try to disable/enable a textbox depending on the input other textbox has.
When role textbox's input is _teacher_, the the subject textbox is enable. Otherwise, disabled.
Problem is it does not enable it back when the input is teacher
function check(event) {
    if ($('#role').val().toLowerCase() == "teacher")
            $("#subject").removeAttr("disabled"); 
    else
        $("#subject").attr("disabled", "disabled"); 
}
view.tpl
<input type="text" class="input-block-level" id="role" onkeypress="check(event)" placeholder="Teacher/HR" name="role"/>
<br/>
<input type="text" class="input-block-level" id="subject" placeholder="Subject(only if Teacher) " name="subject"/>
<br/>
 
    