一个文本框中怎么用多个事件???

luxuezhu 2003-06-13 05:17:19
<input class=inpu type="text" onKeyDown="javascript:return myFilter(event.keyCode, this);" name="lrby_1" size="30" maxlength="20" onChange="lrqm_1.value=12222">

<input class=inpu type="text" name="lrqm_1" size="30" maxlength="20" readonly>

为什么加上 onKeyDown 后 onChange 事件不能调用呢??!
另外,我能不能在onChange中用PHP呢?
...全文
69 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jsidiot 2003-06-13
  • 打赏
  • 举报
回复
不对,刚才讲错了
msdn上面是这么说的。我刚才试了也是。当文本框失去焦点的时候才触发onchange事件
This event is fired when the contents are committed and not while the value is changing. For example, on a text box, this event is not fired while the user is typing, but rather when the user commits the change by leaving the text box that has focus. In addition, this event is executed before the code specified by onblur when the control is also losing the focus.
<input class=inpu type="text" onKeyDown="alert('heihei');" name="lrby_1" size="30" maxlength="20" onchange="lrqm_1.value=12222">

<input class=inpu type="text" name="lrqm_1" size="30" maxlength="20" readonly>
jsidiot 2003-06-13
  • 打赏
  • 举报
回复
onchange是事件。不是属性
jsidiot 2003-06-13
  • 打赏
  • 举报
回复
onpropertyChange="lrqm_1.value=12222">
luxuezhu 2003-06-13
  • 打赏
  • 举报
回复
不是,应该是name,
id 能取值吗?!
lsrzm 2003-06-13
  • 打赏
  • 举报
回复
<input class=inpu type="text" onKeyDown="javascript:return myFilter(event.keyCode, this);"id="lrby_1" size="30" maxlength="20" onChange="lrqm_1.value=12222">
<input type = text id = lrqm_1>

"lrqm_1"是不是id呀

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧