欢迎光临
我们一直在努力

[ASP.NET]按键跳转以及按Enter以不同参数提交,及其他感应事件-.NET教程,Asp.Net开发

建站超值云服务器,限时71元/月

<html>

<head>

<meta http-equiv="content-language" content="zh-cn">

<meta http-equiv="content-type" content="text/html; charset=gb2312">

<title>按键跳转测试</title>

<script language=javascript>

function keypress()

{

akey = event.keycode;

if(akey ==13)

{

gotourl = find.aspx?+event.srcelement.name+=+event.srcelement.value;

window.open(gotourl);

}

}

function keytab1(event)

{

akey = event.keycode;

if(akey ==13)

{

document.forms[0].useraddr.focus();

}

}

function keytab2(event)

{

akey = event.keycode;

if(akey ==13)

{

document.forms[0].userphone.focus();

}

}

function converttoupper(textbox)

{

textbox.value = textbox.value.touppercase();

}

function checknum(str)

{

return str.match(/d/)==null

}

</script>

<style>

<!–

body { font-size: 10pt; font-family: 宋体 }

div { border-style: ridge; border-width: 1px; padding: 10px; background-color:#daf4fe }

–>

</style>

</head>

<body onload="javascript:document.forms[0].userid.focus()">

<div style="width=254px; height:134px">

<form method="post">

<b>查询条件</b>

<hr>

用户编码:<input type="text" name="userid" size="20" onmouseover="this.focus()" onkeypress="keypress()" onfocus="this.select()"><font face="webdings">n</font><br>

用户姓名:<input type="text" name="username" size="20" onmouseover="this.focus()" onkeypress="keypress()" onfocus="this.select()"><font face="webdings">n</font><br>

用户电话:<input type="text" name="userphone" onmouseover="this.focus()" onchange="converttoupper(this)" onkeypress="keytab1(event)" onfocus="this.select()"><br>

用户地址:<input type="text" name="useraddr" onmouseover="this.focus()" onchange="converttoupper(this)" onkeypress="keytab2(event)" onfocus="this.select()">

</form>

</div>

</body>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » [ASP.NET]按键跳转以及按Enter以不同参数提交,及其他感应事件-.NET教程,Asp.Net开发
分享到: 更多 (0)

相关推荐

  • 暂无文章