zoukankan
html css js c++ java
回车后触发提交事件
大家都知道,有时候我们经常是输入完一个字符串后,就直接回车,但是有时候回车并不能触发相应的事件,因此这就需要我们使用其他方法将该事件转换到相应的事件上。
下面就是我的测试代码:
<
div style
=
"
234px; height: 26px
"
>
关键字:
<
asp:TextBox ID
=
"
TextBox1
"
runat
=
"
server
"
CssClass
=
"
editbox3
"
Height
=
"
16px
"
ToolTip
=
"
请用鼠标点击搜索
"
Width
=
"
121px
"
onkeydown
=
"
SubmitSearch()
"
></
asp:TextBox
>&
nbsp;
<
asp:Button ID
=
"
Button1
"
runat
=
"
server
"
CssClass
=
"
button1
"
OnClick
=
"
Button1_Click
"
Text
=
"
查询
"
/></
div
>
<
script language
=
"
javascript
"
>
function SubmitSearch()
{
if
(window.
event
.keyCode
==
13
)
{
document.all(
'
Button1
'
).click();
document.all(
'
Button1
'
).focus(); //如果没有的话好象会出错
}
}
}
</
script
>
查看全文
相关阅读:
Python之__slots__
Python之methodtype方法
Postman+Newman+Jenkins+Git持续集成时遇到的问题
Postman接口测试_Jenkins实现持续集成构建流程01
Git常用命令
Postman接口测试_Newman运行集合脚本
Postman接口测试_创建工作流
使用OpenXML操作PPT公共方法总结
EPPlus实现Excel工作簿中插入图片
centos7配置tomcat为系统服务(systemctl进行管理)
原文地址:https://www.cnblogs.com/ringwang/p/1046144.html
最新文章
spring cloud hystrix dashboard 没有/actuator/hystrix.stream路径解决
Eureka注册中心的自我保护模式
动态修改maven的jdk版本
Spring Cloud和Spring Boot的版本问题
生产者消费者模式
MyISAM和InnoDB的区别
sql语句优化的30种方法
深入Spring源码一 之 核心类、接口关系图(1)
idea 激活码
由HashMap哈希算法引出的求余%和与运算&转换问题
热门文章
ES基础语法学习
Spring事务传播行为详解
Jenkins 部署SpringBoot项目的简单shell脚本
Jenkins 用Tomcat部署War出现
yum安装git
中间件-jekins-首次启动显示已离线的解决方案
Centos后台运行jar包
Python之枚举类型
Python之用__XXX__定制类
Python之Property方法
Copyright © 2011-2022 走看看