日期:2014-05-18  浏览次数:20383 次

onkeypress事件。不处理退格吗?
退格退到文本为空,我想把另一个按钮disabled=false那怎么办?onkeypress不处理这个事件。有事件可以处理不?

------解决方案--------------------
<input type=text id= "tbx " onpropertychange= "if(this.value== ' ') document.all.btn.disabled = true "> <input type=button value= "test " id= "btn ">
------解决方案--------------------
非字符键不触发 onkeypress ,诸如退格 CapsLock 等等

但 onkeydown 和 onkeyup 响应
------解决方案--------------------
TextBox1.Attributes.Add( "onkeyup ",
"if(document.getElementById( ' " + TextBox1.ClientID + " ').Text.ToString()== ' '){

那个.Text.ToString是不行的,.value
------解决方案--------------------
value小写