how to enable or disable a button on keypress event of a textbox in javascript
<p>I created a TextBox :-</p>

<pre><code>TextBox ID="TxtUname" onKeyPress="ENABLE_BTN()"
</code></pre>

<p>Now i wrote a function :-</p>

<pre><code>script type="text/javascript"

window.onload = function() { 
        document.getElementById('SSAccept').disabled = true; 
}; 
function ENABLE_BTN() {
     var EN=document.getElementById('TxtUname').value;
     if(EN=='') {
         document.getElementById('SSAccept').disabled=true;
     } else {
         document.getElementById('SSAccept').disabled=false;
     }
}
&lt;/script&gt;
</code></pre>

<p>BUT STILL THE DISABLED BUTTON IS NOT GETTING ENABLED ON PRESSING ANY KEY IN THE TEXTBOX.
Can anyone tell me what i did wrong ?? Thanks in Advance</p>

<p>Dev..</p>
