How to make textbox enable and disable on change using JQuery

Viewed 76554

I have piece of html code as well as script code. I need solution to handle on change event of one text box that disable act of inputting data in another text field. Could any one help me in regarding.

<div id="cca" class="leaf">
 <label class="control input text" title="">
    <span class="wrap">cca</span>
     <input class="" type="text" value="[Null]"/>
    <span class="warning"></span>
 </label>
</div>
<div id="ccit" class="leaf">
 <label class="control input text" title="">
    <span class="wrap">ccit</span>
     <input class="" type="text" value="[Null]"/>
    <span class="warning"></span>
 </label>
</div>

$(document).ready(function () {        
    alert("hello");        
    $("#cca").on('change', 'label.control input', function (event) {
        alert('I am pretty sure the text box changed');
        $("ccit").prop('disabled',true);
        event.preventDefault();
    });
});
3 Answers
$("#ccit").attr('disabled','disabled');
Related