为什么在IE8,9中输入一次键工作但是相同的代码在chrome和mozila中工作了n次? [英] why Enter key work one time in IE8,9 but same code work n times in chrome and mozila?

查看:90
本文介绍了为什么在IE8,9中输入一次键工作但是相同的代码在chrome和mozila中工作了n次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在开发网站,在一种形式我将使用客户端点击事件(OnClientClick)添加deparment这个事件调用javascript,在那个javascript我将值传递给类在该类文件中的文件我将部门插入访问数据库,如果我点击按钮用鼠标光标它将添加,如果我只是按下输入键按钮第一次它将添加,但下次我没有添加数据,相同的代码当我使用chrome或mozilla运行,如果从键盘输入键n次将添加数据。



为什么在ie8中,ie9在键盘输入键时不添加但是如果我从chrome或mozilla运行它将添加数据。

注意:我已经在部门文本框中使用onkeypress事件。



问候

Aravind

Hi
I am developing website,in one form i will add deparment using client side click event (OnClientClick) this event call javascript,in that javascript i will pass values to class file in that class file i will insert department into access database,if i click button with mouse cursor it will add,if i just hit enter key button first time it will add,but next time i not add data,the same code when i run using chrome or mozilla,if hit Enter key from keyboard n times it will add data.

Why in ie8,ie9 not add when hit enter key from keyboard,but if i run from chrome or mozilla it will add data.
Note: i am already used onkeypress event in department textbox.

Regards
Aravind

推荐答案

这篇关于为什么在IE8,9中输入一次键工作但是相同的代码在chrome和mozila中工作了n次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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