onchange()在IE中不起作用? [英] onchange() is not working in IE?

查看:89
本文介绍了onchange()在IE中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试使用Internet Explorer中的onchange功能检查验证码。但它不起作用..在火狐中它的工作正常..请任何人给我一个解决方案。


这里是我的代码,


< script language =" javascript">

hi to all,

i am trying to check the validation code using onchange function in internet explorer. but it does not working.. in fire fox its working properly.. please any one give me a solution.

here is my code,

<script language="javascript">

展开 | 选择 | Wrap | 行号

推荐答案

onchange doesn'在IE中火了。这是由名为onkeyup的函数引起的。我想你试图确保只输入字母字符,然后设置字段值。而不是只检查输入的密钥,如果不是字母字符则拒绝。
The onchange doesn''t fire in IE. This is caused by the function called onkeyup. I think you''re trying to ensure that only alpha characters are entered, but then you set the field value. Rather than that just check the key entered and reject if not an alpha character.


不要通过改变返回来拦截它,有不一致的地方。


代替操作控制并更改onchange事件中输入的值。

当输入模糊时,
onchange在IE中触发。
don''t intercept it by changing the return, there are inconsistancies.

instead act upon the control and change the input''s value in your onchange event.

onchange fires in IE when the input blurs.


在这种特殊情况下,删除回报不会有所作为。它是name_val函数,它是问题的原因,因为它设置文本框的值可能错误地覆盖了onchange事件。
In this particular case, removing the returns won''t make a difference. It''s the name_val function which is the cause of the problem because it sets the value of the text box probably erroneously overriding the onchange event.


这篇关于onchange()在IE中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆