触发文本框回车事件?
javascript中怎样触发文本框的回车事件?谢谢! --------------------编程问答-------------------- <script>
function evetns()
{
var e=window.event;
if(e.keyCode==13)
{
某控件.focus();
}
}
</script> --------------------编程问答-------------------- javascript
function SubmitKeyClick(button)
{
if (event.keyCode == 13)
{
event.keyCode=9;
event.returnValue = false;
document.all[button].click();
}
}
.cs
page_load中
this.userid.Attributes.Add ("onkeydown","SubmitKeyClick('ImageButton2');");
private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
//ImageButton2_Click代码
} --------------------编程问答--------------------
document.submit();
不知道对不
--------------------编程问答-------------------- <!--按回车光标下移-->
<script type="text/javascript">
document.onkeydown = function(){if(event.keyCode==13 && event.srcElement.type!='button' && event.srcElement.type!='submit' && event.srcElement.type!='reset' && event.srcElement.type!='textarea' && event.srcElement.type!='')
event.keyCode=9;}
</script>
补充:.NET技术 , ASP.NET