自动过帐表格 [英] Auto posting form

查看:58
本文介绍了自动过帐表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在输入用户名和密码时发生btn单击事件,然后单击Tab控件3或4次,然后按Enter键.如果光标处于密码控制下,它将起作用.

I want a btn click event to occur when I enter the username and password then I click tab control 3 or 4 times then i pressed enter key. it works if cursor is in password control.

txtpwd.Attributes.Add("onkeydown", 
"if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13)) 
{
document.getElementById(''" + btnlogin.ClientID + "'').click();return false;
}
} 
else 
{return true}; ");

推荐答案

在我看来,您应该标记您的问题ASP.NET.您喜欢我们猜测吗?

您的代码在txtpwd控件的事件中运行.因此,当然只有在该控件具有焦点的情况下它才起作用.您应该将此代码添加为javascript函数,然后将要提交的所有控件都调用同一方法.他们还应该验证是否输入了某些内容,除非您有验证者单独进行输入.
Seems to me that you should have tagged your question ASP.NET. Did you prefer that we guess ?

Your code runs in the events of the txtpwd control. So, of course it only works if that control has the focus. You should add this code as a javascript function, then have all your controls that you want to submit, call the same method. They should also validate that something has been entered, unless you have validators doing that seperately.


这篇关于自动过帐表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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