在第一个TEXTBOX里面输入编号,通过ENTER键,光标转移到指定的文本框中,并且其文本框显示第一个TEXTBOX编号对应的名称。HLEP!!!
解决方案 »
- 跨页传值???
- ajax Jquery调用webserver中的DateTable
- 登入 login 控件 轉換為可編輯的控件問題
- 求助,关于asp.net中的验证问题~
- asp.net 2.0中gridview中如何动态排名
- 将数据库中保存的图片显示到页面的问题.
- 怎样在C#.asp中的一个页面调用另一个页面的javascript代码?
- 读取XML数据和读取SQL Server数据库哪个开销大?速度哪样快呢?
- 菜鸟送分问题,在线等待
- 请问gridview如何添加行
- 由于大图片放在数据库中读取太慢,我用readtext分段读取,可是最后显示在界面上的图片分段失真,请牛人帮看看!谢谢!
- 文件上传的问题
function DealSearch()
{
if (window.event.keyCode == 13)
{
document.getElementById("TextBox2").onfocus;
document.getElementById("TextBox2").value = document.getElementById("TextBox1").value;
}
}
</script>
{
document.getElementById("TextBox2").onfocus;
document.getElementById("TextBox2").value = document.getElementById("TextBox1").value;
}</script>
...
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
if(e.KeyChar==(char)13) then
SetFocusControl(TextBox5.ClientID)
end if
End Sub Public Sub SetFocusControl(ByVal ControlName As String)
Dim script As String = _
"<script language=" + Chr(34) + "javascript" + Chr(34) _
+ ">" + _
" var control = document.getElementById(" + Chr(34) + _
ControlName + Chr(34) + ");" + _
" if( control != null ){control.focus();}" + _
"</script>"
Page.RegisterStartupScript("Focus", script)
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
if(e.KeyChar==(char)13) then
SetFocusControl(TextBox5.ClientID)
textbox5.text=TextBox4.text
end if
End Sub
if (ActiveControl.Name.ToString() != "textBox1")
{
MessageBox.Show("焦点没在textBox1上");
}
else
{
MessageBox.Show("焦点在textBox1上");
}
<script language="javascript" type="text/javascript">
function setValue(id)
{
if(event.keyCode==13)
{
document.getElementById(id).focus();
document.getElementById(id).value=document.getElementById('text1').value;
}
}
</script><input type="text" id='text1' onkeydown="setValue('text2')" />
<input type="text" id='text2' />
因此需要写一个函数把编号对应的名称根据TextBox1的信息取出来并传给TextBox2。